import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import datetime
import pandas_datareader as web
pd.options.display.max_rows = None
#S&P 500 Benchmark
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
sp = web.DataReader('^GSPC', 'yahoo', start, end)
sp['returns'] = sp['Close'].pct_change(1)
sp['Cumulative Return'] = (1 + sp['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
spmean = sp['returns'].mean()
spvar = sp['returns'].var()
spkurt = sp['returns'].kurt()
spskew = sp['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
spbef = web.DataReader('^GSPC', 'yahoo', start, crashstart)
spbef['avgreturnbefore'] = spbef['Close'].pct_change(1)
spbef['Cumulative Return Before Crash'] = (1 + spbef['avgreturnbefore']).cumprod()
#period of crash
spdur = web.DataReader('^GSPC', 'yahoo', crashstart, crashend)
spdur['avgreturnduring'] = spdur['Close'].pct_change(1)
spdur['Cumulative Return During Crash'] = (1 + spdur['avgreturnduring']).cumprod()
#period after crash
spaft = web.DataReader('^GSPC', 'yahoo', crashend, end)
spaft['avgreturnafter'] = spaft['Close'].pct_change(1)
spaft['Cumulative Return After Crash'] = (1 + spaft['avgreturnafter']).cumprod()
#Energy Stocks
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
apache = web.DataReader('APA', 'yahoo', start, end)
apache['returns'] = apache['Close'].pct_change(1)
apache['Cumulative Return'] = (1 + apache['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
apachemean = apache['returns'].mean()
apachevar = apache['returns'].var()
apachekurt = apache['returns'].kurt()
apacheskew = apache['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
apachebef = web.DataReader('APA', 'yahoo', start, crashstart)
apachebef['avgreturnbefore'] = apachebef['Close'].pct_change(1)
apachebef['Cumulative Return Before Crash'] = (1 + apachebef['avgreturnbefore']).cumprod()
#period of crash
apachedur = web.DataReader('APA', 'yahoo', crashstart, crashend)
apachedur['avgreturnduring'] = apachedur['Close'].pct_change(1)
apachedur['Cumulative Return During Crash'] = (1 + apachedur['avgreturnduring']).cumprod()
#period after crash
apacheaft = web.DataReader('APA', 'yahoo', crashend, end)
apacheaft['avgreturnafter'] = apacheaft['Close'].pct_change(1)
apacheaft['Cumulative Return After Crash'] = (1 + apacheaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
baker = web.DataReader('BKR', 'yahoo', start, end)
baker['returns'] = baker['Close'].pct_change(1)
baker['Cumulative Return'] = (1 + baker['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
bakermean = baker['returns'].mean()
bakervar = baker['returns'].var()
bakerkurt = baker['returns'].kurt()
bakerskew = baker['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
bakerbef = web.DataReader('BKR', 'yahoo', start, crashstart)
bakerbef['avgreturnbefore'] = bakerbef['Close'].pct_change(1)
bakerbef['Cumulative Return Before Crash'] = (1 + bakerbef['avgreturnbefore']).cumprod()
#period of crash
bakerdur = web.DataReader('BKR', 'yahoo', crashstart, crashend)
bakerdur['avgreturnduring'] = bakerdur['Close'].pct_change(1)
bakerdur['Cumulative Return During Crash'] = (1 + bakerdur['avgreturnduring']).cumprod()
#period after crash
bakeraft = web.DataReader('BKR', 'yahoo', crashend, end)
bakeraft['avgreturnafter'] = bakeraft['Close'].pct_change(1)
bakeraft['Cumulative Return After Crash'] = (1 + bakeraft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
cabot = web.DataReader('COG', 'yahoo', start, end)
cabot['returns'] = cabot['Close'].pct_change(1)
cabot['Cumulative Return'] = (1 + cabot['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
cabotmean = cabot['returns'].mean()
cabotvar = cabot['returns'].var()
cabotkurt = cabot['returns'].kurt()
cabotskew = cabot['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
cabotbef = web.DataReader('COG', 'yahoo', start, crashstart)
cabotbef['avgreturnbefore'] = cabotbef['Close'].pct_change(1)
cabotbef['Cumulative Return Before Crash'] = (1 + cabotbef['avgreturnbefore']).cumprod()
#period of crash
cabotdur = web.DataReader('COG', 'yahoo', crashstart, crashend)
cabotdur['avgreturnduring'] = cabotdur['Close'].pct_change(1)
cabotdur['Cumulative Return During Crash'] = (1 + cabotdur['avgreturnduring']).cumprod()
#period after crash
cabotaft = web.DataReader('COG', 'yahoo', crashend, end)
cabotaft['avgreturnafter'] = cabotaft['Close'].pct_change(1)
cabotaft['Cumulative Return After Crash'] = (1 + cabotaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
chevron = web.DataReader('CVX', 'yahoo', start, end)
chevron['returns'] = chevron['Close'].pct_change(1)
chevron['Cumulative Return'] = (1 + chevron['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
chevronmean = chevron['returns'].mean()
chevronvar = chevron['returns'].var()
chevronkurt = chevron['returns'].kurt()
chevronskew = chevron['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
chevronbef = web.DataReader('CVX', 'yahoo', start, crashstart)
chevronbef['avgreturnbefore'] = chevronbef['Close'].pct_change(1)
chevronbef['Cumulative Return Before Crash'] = (1 + chevronbef['avgreturnbefore']).cumprod()
#period of crash
chevrondur = web.DataReader('CVX', 'yahoo', crashstart, crashend)
chevrondur['avgreturnduring'] = chevrondur['Close'].pct_change(1)
chevrondur['Cumulative Return During Crash'] = (1 + chevrondur['avgreturnduring']).cumprod()
#period after crash
chevronaft = web.DataReader('CVX', 'yahoo', crashend, end)
chevronaft['avgreturnafter'] = chevronaft['Close'].pct_change(1)
chevronaft['Cumulative Return After Crash'] = (1 + chevronaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
concho = web.DataReader('CXO', 'yahoo', start, end)
concho['returns'] = concho['Close'].pct_change(1)
concho['Cumulative Return'] = (1 + concho['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
conchomean = concho['returns'].mean()
conchovar = concho['returns'].var()
conchokurt = concho['returns'].kurt()
conchoskew = concho['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
conchobef = web.DataReader('CXO', 'yahoo', start, crashstart)
conchobef['avgreturnbefore'] = conchobef['Close'].pct_change(1)
conchobef['Cumulative Return Before Crash'] = (1 + conchobef['avgreturnbefore']).cumprod()
#period of crash
conchodur = web.DataReader('CXO', 'yahoo', crashstart, crashend)
conchodur['avgreturnduring'] = conchodur['Close'].pct_change(1)
conchodur['Cumulative Return During Crash'] = (1 + conchodur['avgreturnduring']).cumprod()
#period after crash
conchoaft = web.DataReader('CXO', 'yahoo', crashend, end)
conchoaft['avgreturnafter'] = conchoaft['Close'].pct_change(1)
conchoaft['Cumulative Return After Crash'] = (1 + conchoaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
conoco = web.DataReader('COP', 'yahoo', start, end)
conoco['returns'] = conoco['Close'].pct_change(1)
conoco['Cumulative Return'] = (1 + conoco['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
conocomean = conoco['returns'].mean()
conocovar = conoco['returns'].var()
conocokurt = conoco['returns'].kurt()
conocoskew = conoco['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
conocobef = web.DataReader('COP', 'yahoo', start, crashstart)
conocobef['avgreturnbefore'] = conocobef['Close'].pct_change(1)
conocobef['Cumulative Return Before Crash'] = (1 + conocobef['avgreturnbefore']).cumprod()
#period of crash
conocodur = web.DataReader('COP', 'yahoo', crashstart, crashend)
conocodur['avgreturnduring'] = conocodur['Close'].pct_change(1)
conocodur['Cumulative Return During Crash'] = (1 + conocodur['avgreturnduring']).cumprod()
#period after crash
conocoaft = web.DataReader('COP', 'yahoo', crashend, end)
conocoaft['avgreturnafter'] = conocoaft['Close'].pct_change(1)
conocoaft['Cumulative Return After Crash'] = (1 + conocoaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
devon = web.DataReader('DVN', 'yahoo', start, end)
devon['returns'] = devon['Close'].pct_change(1)
devon['Cumulative Return'] = (1 + devon['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
devonmean = devon['returns'].mean()
devonvar = devon['returns'].var()
devonkurt = devon['returns'].kurt()
devonskew = devon['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
devonbef = web.DataReader('DVN', 'yahoo', start, crashstart)
devonbef['avgreturnbefore'] = devonbef['Close'].pct_change(1)
devonbef['Cumulative Return Before Crash'] = (1 + devonbef['avgreturnbefore']).cumprod()
#period of crash
devondur = web.DataReader('DVN', 'yahoo', crashstart, crashend)
devondur['avgreturnduring'] = devondur['Close'].pct_change(1)
devondur['Cumulative Return During Crash'] = (1 + devondur['avgreturnduring']).cumprod()
#period after crash
devonaft = web.DataReader('DVN', 'yahoo', crashend, end)
devonaft['avgreturnafter'] = devonaft['Close'].pct_change(1)
devonaft['Cumulative Return After Crash'] = (1 + devonaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
diamond = web.DataReader('FANG', 'yahoo', start, end)
diamond['returns'] = diamond['Close'].pct_change(1)
diamond['Cumulative Return'] = (1 + diamond['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
diamondmean = diamond['returns'].mean()
diamondvar = diamond['returns'].var()
diamondkurt = diamond['returns'].kurt()
diamondskew = diamond['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
diamondbef = web.DataReader('FANG', 'yahoo', start, crashstart)
diamondbef['avgreturnbefore'] = diamondbef['Close'].pct_change(1)
diamondbef['Cumulative Return Before Crash'] = (1 + diamondbef['avgreturnbefore']).cumprod()
#period of crash
diamonddur = web.DataReader('FANG', 'yahoo', crashstart, crashend)
diamonddur['avgreturnduring'] = diamonddur['Close'].pct_change(1)
diamonddur['Cumulative Return During Crash'] = (1 + diamonddur['avgreturnduring']).cumprod()
#period after crash
diamondaft = web.DataReader('FANG', 'yahoo', crashend, end)
diamondaft['avgreturnafter'] = diamondaft['Close'].pct_change(1)
diamondaft['Cumulative Return After Crash'] = (1 + diamondaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EOG = web.DataReader('EOG', 'yahoo', start, end)
EOG['returns'] = EOG['Close'].pct_change(1)
EOG['Cumulative Return'] = (1 + EOG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EOGmean = EOG['returns'].mean()
EOGvar = EOG['returns'].var()
EOGkurt = EOG['returns'].kurt()
EOGskew = EOG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EOGbef = web.DataReader('EOG', 'yahoo', start, crashstart)
EOGbef['avgreturnbefore'] = EOGbef['Close'].pct_change(1)
EOGbef['Cumulative Return Before Crash'] = (1 + EOGbef['avgreturnbefore']).cumprod()
#period of crash
EOGdur = web.DataReader('EOG', 'yahoo', crashstart, crashend)
EOGdur['avgreturnduring'] = EOGdur['Close'].pct_change(1)
EOGdur['Cumulative Return During Crash'] = (1 + EOGdur['avgreturnduring']).cumprod()
#period after crash
EOGaft = web.DataReader('EOG', 'yahoo', crashend, end)
EOGaft['avgreturnafter'] = EOGaft['Close'].pct_change(1)
EOGaft['Cumulative Return After Crash'] = (1 + EOGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
exxon = web.DataReader('XOM', 'yahoo', start, end)
exxon['returns'] = exxon['Close'].pct_change(1)
exxon['Cumulative Return'] = (1 + exxon['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
exxonmean = exxon['returns'].mean()
exxonvar = exxon['returns'].var()
exxonkurt = exxon['returns'].kurt()
exxonskew = exxon['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
exxonbef = web.DataReader('XOM', 'yahoo', start, crashstart)
exxonbef['avgreturnbefore'] = exxonbef['Close'].pct_change(1)
exxonbef['Cumulative Return Before Crash'] = (1 + exxonbef['avgreturnbefore']).cumprod()
#period of crash
exxondur = web.DataReader('XOM', 'yahoo', crashstart, crashend)
exxondur['avgreturnduring'] = exxondur['Close'].pct_change(1)
exxondur['Cumulative Return During Crash'] = (1 + exxondur['avgreturnduring']).cumprod()
#period after crash
exxonaft = web.DataReader('XOM', 'yahoo', crashend, end)
exxonaft['avgreturnafter'] = exxonaft['Close'].pct_change(1)
exxonaft['Cumulative Return After Crash'] = (1 + exxonaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
halliburton = web.DataReader('HAL', 'yahoo', start, end)
halliburton['returns'] = halliburton['Close'].pct_change(1)
halliburton['Cumulative Return'] = (1 + halliburton['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
halliburtonmean = halliburton['returns'].mean()
halliburtonvar = halliburton['returns'].var()
halliburtonkurt = halliburton['returns'].kurt()
halliburtonskew = halliburton['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
halliburtonbef = web.DataReader('HAL', 'yahoo', start, crashstart)
halliburtonbef['avgreturnbefore'] = halliburtonbef['Close'].pct_change(1)
halliburtonbef['Cumulative Return Before Crash'] = (1 + halliburtonbef['avgreturnbefore']).cumprod()
#period of crash
halliburtondur = web.DataReader('HAL', 'yahoo', crashstart, crashend)
halliburtondur['avgreturnduring'] = halliburtondur['Close'].pct_change(1)
halliburtondur['Cumulative Return During Crash'] = (1 + halliburtondur['avgreturnduring']).cumprod()
#period after crash
halliburtonaft = web.DataReader('HAL', 'yahoo', crashend, end)
halliburtonaft['avgreturnafter'] = halliburtonaft['Close'].pct_change(1)
halliburtonaft['Cumulative Return After Crash'] = (1 + halliburtonaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
hess = web.DataReader('HES', 'yahoo', start, end)
hess['returns'] = hess['Close'].pct_change(1)
hess['Cumulative Return'] = (1 + hess['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
hessmean = hess['returns'].mean()
hessvar = hess['returns'].var()
hesskurt = hess['returns'].kurt()
hessskew = hess['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
hessbef = web.DataReader('HES', 'yahoo', start, crashstart)
hessbef['avgreturnbefore'] = hessbef['Close'].pct_change(1)
hessbef['Cumulative Return Before Crash'] = (1 + hessbef['avgreturnbefore']).cumprod()
#period of crash
hessdur = web.DataReader('HES', 'yahoo', crashstart, crashend)
hessdur['avgreturnduring'] = hessdur['Close'].pct_change(1)
hessdur['Cumulative Return During Crash'] = (1 + hessdur['avgreturnduring']).cumprod()
#period after crash
hessaft = web.DataReader('HES', 'yahoo', crashend, end)
hessaft['avgreturnafter'] = hessaft['Close'].pct_change(1)
hessaft['Cumulative Return After Crash'] = (1 + hessaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
holly = web.DataReader('HFC', 'yahoo', start, end)
holly['returns'] = holly['Close'].pct_change(1)
holly['Cumulative Return'] = (1 + holly['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
hollymean = holly['returns'].mean()
hollyvar = holly['returns'].var()
hollykurt = holly['returns'].kurt()
hollyskew = holly['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
hollybef = web.DataReader('HFC', 'yahoo', start, crashstart)
hollybef['avgreturnbefore'] = hollybef['Close'].pct_change(1)
hollybef['Cumulative Return Before Crash'] = (1 + hollybef['avgreturnbefore']).cumprod()
#period of crash
hollydur = web.DataReader('HFC', 'yahoo', crashstart, crashend)
hollydur['avgreturnduring'] = hollydur['Close'].pct_change(1)
hollydur['Cumulative Return During Crash'] = (1 + hollydur['avgreturnduring']).cumprod()
#period after crash
hollyaft = web.DataReader('HFC', 'yahoo', crashend, end)
hollyaft['avgreturnafter'] = hollyaft['Close'].pct_change(1)
hollyaft['Cumulative Return After Crash'] = (1 + hollyaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
kinder = web.DataReader('KMI', 'yahoo', start, end)
kinder['returns'] = kinder['Close'].pct_change(1)
kinder['Cumulative Return'] = (1 + kinder['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
kindermean = kinder['returns'].mean()
kindervar = kinder['returns'].var()
kinderkurt = kinder['returns'].kurt()
kinderskew = kinder['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
kinderbef = web.DataReader('KMI', 'yahoo', start, crashstart)
kinderbef['avgreturnbefore'] = kinderbef['Close'].pct_change(1)
kinderbef['Cumulative Return Before Crash'] = (1 + kinderbef['avgreturnbefore']).cumprod()
#period of crash
kinderdur = web.DataReader('KMI', 'yahoo', crashstart, crashend)
kinderdur['avgreturnduring'] = kinderdur['Close'].pct_change(1)
kinderdur['Cumulative Return During Crash'] = (1 + kinderdur['avgreturnduring']).cumprod()
#period after crash
kinderaft = web.DataReader('KMI', 'yahoo', crashend, end)
kinderaft['avgreturnafter'] = kinderaft['Close'].pct_change(1)
kinderaft['Cumulative Return After Crash'] = (1 + kinderaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
marathonoil = web.DataReader('MRO', 'yahoo', start, end)
marathonoil['returns'] = marathonoil['Close'].pct_change(1)
marathonoil['Cumulative Return'] = (1 + marathonoil['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
marathonoilmean = marathonoil['returns'].mean()
marathonoilvar = marathonoil['returns'].var()
marathonoilkurt = marathonoil['returns'].kurt()
marathonoilskew = marathonoil['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
marathonoilbef = web.DataReader('MRO', 'yahoo', start, crashstart)
marathonoilbef['avgreturnbefore'] = marathonoilbef['Close'].pct_change(1)
marathonoilbef['Cumulative Return Before Crash'] = (1 + marathonoilbef['avgreturnbefore']).cumprod()
#period of crash
marathonoildur = web.DataReader('MRO', 'yahoo', crashstart, crashend)
marathonoildur['avgreturnduring'] = marathonoildur['Close'].pct_change(1)
marathonoildur['Cumulative Return During Crash'] = (1 + marathonoildur['avgreturnduring']).cumprod()
#period after crash
marathonoilaft = web.DataReader('MRO', 'yahoo', crashend, end)
marathonoilaft['avgreturnafter'] = marathonoilaft['Close'].pct_change(1)
marathonoilaft['Cumulative Return After Crash'] = (1 + marathonoilaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
marathonpet = web.DataReader('MPC', 'yahoo', start, end)
marathonpet['returns'] = marathonpet['Close'].pct_change(1)
marathonpet['Cumulative Return'] = (1 + marathonpet['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
marathonpetmean = marathonpet['returns'].mean()
marathonpetvar = marathonpet['returns'].var()
marathonpetkurt = marathonpet['returns'].kurt()
marathonpetskew = marathonpet['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
marathonpetbef = web.DataReader('MPC', 'yahoo', start, crashstart)
marathonpetbef['avgreturnbefore'] = marathonpetbef['Close'].pct_change(1)
marathonpetbef['Cumulative Return Before Crash'] = (1 + marathonpetbef['avgreturnbefore']).cumprod()
#period of crash
marathonpetdur = web.DataReader('MPC', 'yahoo', crashstart, crashend)
marathonpetdur['avgreturnduring'] = marathonpetdur['Close'].pct_change(1)
marathonpetdur['Cumulative Return During Crash'] = (1 + marathonpetdur['avgreturnduring']).cumprod()
#period after crash
marathonpetaft = web.DataReader('MPC', 'yahoo', crashend, end)
marathonpetaft['avgreturnafter'] = marathonpetaft['Close'].pct_change(1)
marathonpetaft['Cumulative Return After Crash'] = (1 + marathonpetaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
national = web.DataReader('NOV', 'yahoo', start, end)
national['returns'] = national['Close'].pct_change(1)
national['Cumulative Return'] = (1 + national['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
nationalmean = national['returns'].mean()
nationalvar = national['returns'].var()
nationalkurt = national['returns'].kurt()
nationalskew = national['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
nationalbef = web.DataReader('NOV', 'yahoo', start, crashstart)
nationalbef['avgreturnbefore'] = nationalbef['Close'].pct_change(1)
nationalbef['Cumulative Return Before Crash'] = (1 + nationalbef['avgreturnbefore']).cumprod()
#period of crash
nationaldur = web.DataReader('NOV', 'yahoo', crashstart, crashend)
nationaldur['avgreturnduring'] = nationaldur['Close'].pct_change(1)
nationaldur['Cumulative Return During Crash'] = (1 + nationaldur['avgreturnduring']).cumprod()
#period after crash
nationalaft = web.DataReader('NOV', 'yahoo', crashend, end)
nationalaft['avgreturnafter'] = nationalaft['Close'].pct_change(1)
nationalaft['Cumulative Return After Crash'] = (1 + nationalaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
noble = web.DataReader('NBL', 'yahoo', start, end)
noble['returns'] = noble['Close'].pct_change(1)
noble['Cumulative Return'] = (1 + noble['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
noblemean = noble['returns'].mean()
noblevar = noble['returns'].var()
noblekurt = noble['returns'].kurt()
nobleskew = noble['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
noblebef = web.DataReader('NBL', 'yahoo', start, crashstart)
noblebef['avgreturnbefore'] = noblebef['Close'].pct_change(1)
noblebef['Cumulative Return Before Crash'] = (1 + noblebef['avgreturnbefore']).cumprod()
#period of crash
nobledur = web.DataReader('NBL', 'yahoo', crashstart, crashend)
nobledur['avgreturnduring'] = nobledur['Close'].pct_change(1)
nobledur['Cumulative Return During Crash'] = (1 + nobledur['avgreturnduring']).cumprod()
#period after crash
nobleaft = web.DataReader('NBL', 'yahoo', crashend, end)
nobleaft['avgreturnafter'] = nobleaft['Close'].pct_change(1)
nobleaft['Cumulative Return After Crash'] = (1 + nobleaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
occidental = web.DataReader('OXY', 'yahoo', start, end)
occidental['returns'] = occidental['Close'].pct_change(1)
occidental['Cumulative Return'] = (1 + occidental['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
occidentalmean = occidental['returns'].mean()
occidentalvar = occidental['returns'].var()
occidentalkurt = occidental['returns'].kurt()
occidentalskew = occidental['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
occidentalbef = web.DataReader('OXY', 'yahoo', start, crashstart)
occidentalbef['avgreturnbefore'] = occidentalbef['Close'].pct_change(1)
occidentalbef['Cumulative Return Before Crash'] = (1 + occidentalbef['avgreturnbefore']).cumprod()
#period of crash
occidentaldur = web.DataReader('OXY', 'yahoo', crashstart, crashend)
occidentaldur['avgreturnduring'] = occidentaldur['Close'].pct_change(1)
occidentaldur['Cumulative Return During Crash'] = (1 + occidentaldur['avgreturnduring']).cumprod()
#period after crash
occidentalaft = web.DataReader('OXY', 'yahoo', crashend, end)
occidentalaft['avgreturnafter'] = occidentalaft['Close'].pct_change(1)
occidentalaft['Cumulative Return After Crash'] = (1 + occidentalaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
oneok = web.DataReader('OKE', 'yahoo', start, end)
oneok['returns'] = oneok['Close'].pct_change(1)
oneok['Cumulative Return'] = (1 + oneok['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
oneokmean = oneok['returns'].mean()
oneokvar = oneok['returns'].var()
oneokkurt = oneok['returns'].kurt()
oneokskew = oneok['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
oneokbef = web.DataReader('OKE', 'yahoo', start, crashstart)
oneokbef['avgreturnbefore'] = oneokbef['Close'].pct_change(1)
oneokbef['Cumulative Return Before Crash'] = (1 + oneokbef['avgreturnbefore']).cumprod()
#period of crash
oneokdur = web.DataReader('OKE', 'yahoo', crashstart, crashend)
oneokdur['avgreturnduring'] = oneokdur['Close'].pct_change(1)
oneokdur['Cumulative Return During Crash'] = (1 + oneokdur['avgreturnduring']).cumprod()
#period after crash
oneokaft = web.DataReader('OKE', 'yahoo', crashend, end)
oneokaft['avgreturnafter'] = oneokaft['Close'].pct_change(1)
oneokaft['Cumulative Return After Crash'] = (1 + oneokaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
phillips66 = web.DataReader('PSX', 'yahoo', start, end)
phillips66['returns'] = phillips66['Close'].pct_change(1)
phillips66['Cumulative Return'] = (1 + phillips66['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
phillips66mean = phillips66['returns'].mean()
phillips66var = phillips66['returns'].var()
phillips66kurt = phillips66['returns'].kurt()
phillips66skew = phillips66['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
phillips66bef = web.DataReader('PSX', 'yahoo', start, crashstart)
phillips66bef['avgreturnbefore'] = phillips66bef['Close'].pct_change(1)
phillips66bef['Cumulative Return Before Crash'] = (1 + phillips66bef['avgreturnbefore']).cumprod()
#period of crash
phillips66dur = web.DataReader('PSX', 'yahoo', crashstart, crashend)
phillips66dur['avgreturnduring'] = phillips66dur['Close'].pct_change(1)
phillips66dur['Cumulative Return During Crash'] = (1 + phillips66dur['avgreturnduring']).cumprod()
#period after crash
phillips66aft = web.DataReader('PSX', 'yahoo', crashend, end)
phillips66aft['avgreturnafter'] = phillips66aft['Close'].pct_change(1)
phillips66aft['Cumulative Return After Crash'] = (1 + phillips66aft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
pioneer = web.DataReader('PXD', 'yahoo', start, end)
pioneer['returns'] = pioneer['Close'].pct_change(1)
pioneer['Cumulative Return'] = (1 + pioneer['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
pioneermean = pioneer['returns'].mean()
pioneervar = pioneer['returns'].var()
pioneerkurt = pioneer['returns'].kurt()
pioneerskew = pioneer['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
pioneerbef = web.DataReader('PXD', 'yahoo', start, crashstart)
pioneerbef['avgreturnbefore'] = pioneerbef['Close'].pct_change(1)
pioneerbef['Cumulative Return Before Crash'] = (1 + pioneerbef['avgreturnbefore']).cumprod()
#period of crash
pioneerdur = web.DataReader('PXD', 'yahoo', crashstart, crashend)
pioneerdur['avgreturnduring'] = pioneerdur['Close'].pct_change(1)
pioneerdur['Cumulative Return During Crash'] = (1 + pioneerdur['avgreturnduring']).cumprod()
#period after crash
pioneeraft = web.DataReader('PXD', 'yahoo', crashend, end)
pioneeraft['avgreturnafter'] = pioneeraft['Close'].pct_change(1)
pioneeraft['Cumulative Return After Crash'] = (1 + pioneeraft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
schlumberger = web.DataReader('SLB', 'yahoo', start, end)
schlumberger['returns'] = schlumberger['Close'].pct_change(1)
schlumberger['Cumulative Return'] = (1 + schlumberger['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
schlumbergermean = schlumberger['returns'].mean()
schlumbergervar = schlumberger['returns'].var()
schlumbergerkurt = schlumberger['returns'].kurt()
schlumbergerskew = schlumberger['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
schlumbergerbef = web.DataReader('SLB', 'yahoo', start, crashstart)
schlumbergerbef['avgreturnbefore'] = schlumbergerbef['Close'].pct_change(1)
schlumbergerbef['Cumulative Return Before Crash'] = (1 + schlumbergerbef['avgreturnbefore']).cumprod()
#period of crash
schlumbergerdur = web.DataReader('SLB', 'yahoo', crashstart, crashend)
schlumbergerdur['avgreturnduring'] = schlumbergerdur['Close'].pct_change(1)
schlumbergerdur['Cumulative Return During Crash'] = (1 + schlumbergerdur['avgreturnduring']).cumprod()
#period after crash
schlumbergeraft = web.DataReader('SLB', 'yahoo', crashend, end)
schlumbergeraft['avgreturnafter'] = schlumbergeraft['Close'].pct_change(1)
schlumbergeraft['Cumulative Return After Crash'] = (1 + schlumbergeraft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
technip = web.DataReader('FTI', 'yahoo', start, end)
technip['returns'] = technip['Close'].pct_change(1)
technip['Cumulative Return'] = (1 + technip['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
technipmean = technip['returns'].mean()
technipvar = technip['returns'].var()
technipkurt = technip['returns'].kurt()
technipskew = technip['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
technipbef = web.DataReader('FTI', 'yahoo', start, crashstart)
technipbef['avgreturnbefore'] = technipbef['Close'].pct_change(1)
technipbef['Cumulative Return Before Crash'] = (1 + technipbef['avgreturnbefore']).cumprod()
#period of crash
technipdur = web.DataReader('FTI', 'yahoo', crashstart, crashend)
technipdur['avgreturnduring'] = technipdur['Close'].pct_change(1)
technipdur['Cumulative Return During Crash'] = (1 + technipdur['avgreturnduring']).cumprod()
#period after crash
technipaft = web.DataReader('FTI', 'yahoo', crashend, end)
technipaft['avgreturnafter'] = technipaft['Close'].pct_change(1)
technipaft['Cumulative Return After Crash'] = (1 + technipaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
valero = web.DataReader('VLO', 'yahoo', start, end)
valero['returns'] = valero['Close'].pct_change(1)
valero['Cumulative Return'] = (1 + valero['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
valeromean = valero['returns'].mean()
valerovar = valero['returns'].var()
valerokurt = valero['returns'].kurt()
valeroskew = valero['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
valerobef = web.DataReader('VLO', 'yahoo', start, crashstart)
valerobef['avgreturnbefore'] = valerobef['Close'].pct_change(1)
valerobef['Cumulative Return Before Crash'] = (1 + valerobef['avgreturnbefore']).cumprod()
#period of crash
valerodur = web.DataReader('VLO', 'yahoo', crashstart, crashend)
valerodur['avgreturnduring'] = valerodur['Close'].pct_change(1)
valerodur['Cumulative Return During Crash'] = (1 + valerodur['avgreturnduring']).cumprod()
#period after crash
valeroaft = web.DataReader('VLO', 'yahoo', crashend, end)
valeroaft['avgreturnafter'] = valeroaft['Close'].pct_change(1)
valeroaft['Cumulative Return After Crash'] = (1 + valeroaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
williams = web.DataReader('WMB', 'yahoo', start, end)
williams['returns'] = williams['Close'].pct_change(1)
williams['Cumulative Return'] = (1 + williams['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
williamsmean = williams['returns'].mean()
williamsvar = williams['returns'].var()
williamskurt = williams['returns'].kurt()
williamsskew = williams['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
williamsbef = web.DataReader('WMB', 'yahoo', start, crashstart)
williamsbef['avgreturnbefore'] = williamsbef['Close'].pct_change(1)
williamsbef['Cumulative Return Before Crash'] = (1 + williamsbef['avgreturnbefore']).cumprod()
#period of crash
williamsdur = web.DataReader('WMB', 'yahoo', crashstart, crashend)
williamsdur['avgreturnduring'] = williamsdur['Close'].pct_change(1)
williamsdur['Cumulative Return During Crash'] = (1 + williamsdur['avgreturnduring']).cumprod()
#period after crash
williamsaft = web.DataReader('WMB', 'yahoo', crashend, end)
williamsaft['avgreturnafter'] = williamsaft['Close'].pct_change(1)
williamsaft['Cumulative Return After Crash'] = (1 + williamsaft['avgreturnafter']).cumprod()
#histogram of Energy Stock Returns
sp['returns'].hist(bins = 50, label ='S&P 500', alpha=0.5)
apache['returns'].hist(bins = 50, label ='Apache', figsize = (10,8), alpha=0.5)
baker['returns'].hist(bins = 50, label ='Baker', alpha=0.5)
cabot['returns'].hist(bins = 50, label ='Cabot', alpha=0.5)
chevron['returns'].hist(bins = 50, label ='Chevron', alpha=0.5)
concho['returns'].hist(bins = 50, label ='Concho', alpha=0.5)
conoco['returns'].hist(bins = 50, label ='Conoco', alpha=0.5)
devon['returns'].hist(bins = 50, label ='Devon', alpha=0.5)
diamond['returns'].hist(bins = 50, label ='Diamond', alpha=0.5)
EOG['returns'].hist(bins = 50, label ='EOG', alpha=0.5)
exxon['returns'].hist(bins = 50, label ='Exxon', alpha=0.5)
halliburton['returns'].hist(bins = 50, label ='Halliburton', alpha=0.5)
hess['returns'].hist(bins = 50, label ='Hess', alpha=0.5)
holly['returns'].hist(bins = 50, label ='Holly', alpha=0.5)
kinder['returns'].hist(bins = 50, label ='Kinder', alpha=0.5)
marathonoil['returns'].hist(bins = 50, label ='MarathonOil', alpha=0.5)
marathonpet['returns'].hist(bins = 50, label ='MarathonPet', alpha=0.5)
national['returns'].hist(bins = 50, label ='National', alpha=0.5)
noble['returns'].hist(bins = 50, label ='Noble', alpha=0.5)
occidental['returns'].hist(bins = 50, label ='Occidental', alpha=0.5)
oneok['returns'].hist(bins = 50, label ='Oneok', alpha=0.5)
phillips66['returns'].hist(bins = 50, label ='Phillips66', alpha=0.5)
pioneer['returns'].hist(bins = 50, label ='Pioneer', alpha=0.5)
schlumberger['returns'].hist(bins = 50, label ='Schlumberger', alpha=0.5)
technip['returns'].hist(bins = 50, label ='Technip', alpha=0.5)
valero['returns'].hist(bins = 50, label ='Valero', alpha=0.5)
williams['returns'].hist(bins = 50, label ='Williams', alpha=0.5)
plt.legend()
#KDE Plot for Energy Sector
sp['returns'].plot(kind = 'kde', label ='S&P 500', alpha=0.5)
apache['returns'].plot(kind = 'kde', label ='Apache', figsize = (10,8), alpha=0.5, title = 'KDE of Energy Stocks')
baker['returns'].plot(kind = 'kde', label ='Baker', alpha=0.5)
cabot['returns'].plot(kind = 'kde', label ='Cabot', alpha=0.5)
chevron['returns'].plot(kind = 'kde', label ='Chevron', alpha=0.5)
concho['returns'].plot(kind = 'kde', label ='Concho', alpha=0.5)
conoco['returns'].plot(kind = 'kde', label ='Conoco', alpha=0.5)
devon['returns'].plot(kind = 'kde', label ='Devon', alpha=0.5)
diamond['returns'].plot(kind = 'kde', label ='Diamond', alpha=0.5)
EOG['returns'].plot(kind = 'kde', label ='EOG', alpha=0.5)
exxon['returns'].plot(kind = 'kde', label ='Exxon', alpha=0.5)
halliburton['returns'].plot(kind = 'kde', label ='Halliburton', alpha=0.5)
hess['returns'].plot(kind = 'kde', label ='Hess', alpha=0.5)
holly['returns'].plot(kind = 'kde', label ='Holly', alpha=0.5)
kinder['returns'].plot(kind = 'kde', label ='Kinder', alpha=0.5)
marathonoil['returns'].plot(kind = 'kde', label ='MarathonOil', alpha=0.5)
marathonpet['returns'].plot(kind = 'kde', label ='MarathonPet', alpha=0.5)
national['returns'].plot(kind = 'kde', label ='National', alpha=0.5)
noble['returns'].plot(kind = 'kde', label ='Noble', alpha=0.5)
occidental['returns'].plot(kind = 'kde', label ='Occidental', alpha=0.5)
oneok['returns'].plot(kind = 'kde', label ='Oneok', alpha=0.5)
phillips66['returns'].plot(kind = 'kde', label ='Phillips66', alpha=0.5)
pioneer['returns'].plot(kind = 'kde', label ='Pioneer', alpha=0.5)
schlumberger['returns'].plot(kind = 'kde', label ='Schlumberger', alpha=0.5)
technip['returns'].plot(kind = 'kde', label ='Technip', alpha=0.5)
valero['returns'].plot(kind = 'kde', label ='Valero', alpha=0.5)
williams['returns'].plot(kind = 'kde', label ='Williams', alpha=0.5)
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Boxplots comparing returns for Energy Sector
box_df = pd.concat([sp['returns'],apache['returns'],baker['returns'],cabot['returns'],chevron['returns'],concho['returns'],conoco['returns'],devon['returns'],diamond['returns'],EOG['returns'],exxon['returns'],halliburton['returns'],hess['returns'],holly['returns'],kinder['returns'],marathonoil['returns'],marathonpet['returns'],national['returns'],noble['returns'],occidental['returns'],oneok['returns'],phillips66['returns'],pioneer['returns'],schlumberger['returns'],technip['returns'],valero['returns'],williams['returns']], axis=1)
box_df.columns = ['S&P 500','Apache','Baker','Cabot','Chevron','Concho','Conoco','Devon','Diamond','EOG','Exxon','Halliburton','Hess','Holly','Kinder','MarathonOil','MarathonPet','National','Noble','Occidental','Oneok','Phillips66','Pioneer','Schlumberger','Technip','Valero','Williams']
box_df.plot(kind='box', figsize=(30,10), colormap= 'jet', title = 'Boxplots of Energy Sector Returns')
#Cumulative Returns Whole period
sp['Cumulative Return'].plot(label="S&P 500")
apache['Cumulative Return'].plot(label='Apache', figsize=(16,8), title = 'Cumulative Return of Energy Stocks')
baker['Cumulative Return'].plot(label="Baker")
cabot['Cumulative Return'].plot(label="Cabot")
chevron['Cumulative Return'].plot(label="Chevron")
concho['Cumulative Return'].plot(label="Concho")
conoco['Cumulative Return'].plot(label="Conoco")
devon['Cumulative Return'].plot(label="Devon")
diamond['Cumulative Return'].plot(label="Diamond")
EOG['Cumulative Return'].plot(label="EOG")
exxon['Cumulative Return'].plot(label="Exxon")
halliburton['Cumulative Return'].plot(label="Halliburton")
hess['Cumulative Return'].plot(label="Hess")
holly['Cumulative Return'].plot(label="Holly")
kinder['Cumulative Return'].plot(label="Kinder")
marathonoil['Cumulative Return'].plot(label="MarathonOil")
marathonpet['Cumulative Return'].plot(label="MarathonPet")
national['Cumulative Return'].plot(label="National")
noble['Cumulative Return'].plot(label="Noble")
occidental['Cumulative Return'].plot(label="Occidental")
oneok['Cumulative Return'].plot(label="Oneok")
phillips66['Cumulative Return'].plot(label="Phillip66")
pioneer['Cumulative Return'].plot(label="Pioneer")
schlumberger['Cumulative Return'].plot(label="Schlemberger")
technip['Cumulative Return'].plot(label="Technip")
valero['Cumulative Return'].plot(label="Valero")
williams['Cumulative Return'].plot(label="Williams")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Sorting by Cumulative Return
cumret = {'Cumulative Returns 12/4-6/5': [sp['Cumulative Return'].iloc[-1],apache['Cumulative Return'].iloc[-1],baker['Cumulative Return'].iloc[-1],cabot['Cumulative Return'].iloc[-1],chevron['Cumulative Return'].iloc[-1],concho['Cumulative Return'].iloc[-1],conoco['Cumulative Return'].iloc[-1],devon['Cumulative Return'].iloc[-1],diamond['Cumulative Return'].iloc[-1],EOG['Cumulative Return'].iloc[-1],exxon['Cumulative Return'].iloc[-1],halliburton['Cumulative Return'].iloc[-1],hess['Cumulative Return'].iloc[-1],holly['Cumulative Return'].iloc[-1],kinder['Cumulative Return'].iloc[-1],marathonoil['Cumulative Return'].iloc[-1],marathonpet['Cumulative Return'].iloc[-1],national['Cumulative Return'].iloc[-1],noble['Cumulative Return'].iloc[-1],occidental['Cumulative Return'].iloc[-1],oneok['Cumulative Return'].iloc[-1],phillips66['Cumulative Return'].iloc[-1],pioneer['Cumulative Return'].iloc[-1],schlumberger['Cumulative Return'].iloc[-1],technip['Cumulative Return'].iloc[-1],valero['Cumulative Return'].iloc[-1],williams['Cumulative Return'].iloc[-1]],
'Cumulative Returns 12/4-2/20': [spbef['Cumulative Return Before Crash'].iloc[-1],apachebef['Cumulative Return Before Crash'].iloc[-1],bakerbef['Cumulative Return Before Crash'].iloc[-1],cabotbef['Cumulative Return Before Crash'].iloc[-1],chevronbef['Cumulative Return Before Crash'].iloc[-1],conchobef['Cumulative Return Before Crash'].iloc[-1],conocobef['Cumulative Return Before Crash'].iloc[-1],devonbef['Cumulative Return Before Crash'].iloc[-1],diamondbef['Cumulative Return Before Crash'].iloc[-1],EOGbef['Cumulative Return Before Crash'].iloc[-1],exxonbef['Cumulative Return Before Crash'].iloc[-1],halliburtonbef['Cumulative Return Before Crash'].iloc[-1],hessbef['Cumulative Return Before Crash'].iloc[-1],hollybef['Cumulative Return Before Crash'].iloc[-1],kinderbef['Cumulative Return Before Crash'].iloc[-1],marathonoilbef['Cumulative Return Before Crash'].iloc[-1],marathonpetbef['Cumulative Return Before Crash'].iloc[-1],nationalbef['Cumulative Return Before Crash'].iloc[-1],noblebef['Cumulative Return Before Crash'].iloc[-1],occidentalbef['Cumulative Return Before Crash'].iloc[-1],oneokbef['Cumulative Return Before Crash'].iloc[-1],phillips66bef['Cumulative Return Before Crash'].iloc[-1],pioneerbef['Cumulative Return Before Crash'].iloc[-1],schlumbergerbef['Cumulative Return Before Crash'].iloc[-1],technipbef['Cumulative Return Before Crash'].iloc[-1],valerobef['Cumulative Return Before Crash'].iloc[-1],williamsbef['Cumulative Return Before Crash'].iloc[-1]],
'Cumulative Returns 2/20-3/23': [spdur['Cumulative Return During Crash'].iloc[-1],apachedur['Cumulative Return During Crash'].iloc[-1],bakerdur['Cumulative Return During Crash'].iloc[-1],cabotdur['Cumulative Return During Crash'].iloc[-1],chevrondur['Cumulative Return During Crash'].iloc[-1],conchodur['Cumulative Return During Crash'].iloc[-1],conocodur['Cumulative Return During Crash'].iloc[-1],devondur['Cumulative Return During Crash'].iloc[-1],diamonddur['Cumulative Return During Crash'].iloc[-1],EOGdur['Cumulative Return During Crash'].iloc[-1],exxondur['Cumulative Return During Crash'].iloc[-1],halliburtondur['Cumulative Return During Crash'].iloc[-1],hessdur['Cumulative Return During Crash'].iloc[-1],hollydur['Cumulative Return During Crash'].iloc[-1],kinderdur['Cumulative Return During Crash'].iloc[-1],marathonoildur['Cumulative Return During Crash'].iloc[-1],marathonpetdur['Cumulative Return During Crash'].iloc[-1],nationaldur['Cumulative Return During Crash'].iloc[-1],nobledur['Cumulative Return During Crash'].iloc[-1],occidentaldur['Cumulative Return During Crash'].iloc[-1],oneokdur['Cumulative Return During Crash'].iloc[-1],phillips66dur['Cumulative Return During Crash'].iloc[-1],pioneerdur['Cumulative Return During Crash'].iloc[-1],schlumbergerdur['Cumulative Return During Crash'].iloc[-1],technipdur['Cumulative Return During Crash'].iloc[-1],valerodur['Cumulative Return During Crash'].iloc[-1],williamsdur['Cumulative Return During Crash'].iloc[-1]],
'Cumulative Returns 3/23-6/5': [spaft['Cumulative Return After Crash'].iloc[-1],apacheaft['Cumulative Return After Crash'].iloc[-1],bakeraft['Cumulative Return After Crash'].iloc[-1],cabotaft['Cumulative Return After Crash'].iloc[-1],chevronaft['Cumulative Return After Crash'].iloc[-1],conchoaft['Cumulative Return After Crash'].iloc[-1],conocoaft['Cumulative Return After Crash'].iloc[-1],devonaft['Cumulative Return After Crash'].iloc[-1],diamondaft['Cumulative Return After Crash'].iloc[-1],EOGaft['Cumulative Return After Crash'].iloc[-1],exxonaft['Cumulative Return After Crash'].iloc[-1],halliburtonaft['Cumulative Return After Crash'].iloc[-1],hessaft['Cumulative Return After Crash'].iloc[-1],hollyaft['Cumulative Return After Crash'].iloc[-1],kinderaft['Cumulative Return After Crash'].iloc[-1],marathonoilaft['Cumulative Return After Crash'].iloc[-1],marathonpetaft['Cumulative Return After Crash'].iloc[-1],nationalaft['Cumulative Return After Crash'].iloc[-1],nobleaft['Cumulative Return After Crash'].iloc[-1],occidentalaft['Cumulative Return After Crash'].iloc[-1],oneokaft['Cumulative Return After Crash'].iloc[-1],phillips66aft['Cumulative Return After Crash'].iloc[-1],pioneeraft['Cumulative Return After Crash'].iloc[-1],schlumbergeraft['Cumulative Return After Crash'].iloc[-1],technipaft['Cumulative Return After Crash'].iloc[-1],valeroaft['Cumulative Return After Crash'].iloc[-1],williamsaft['Cumulative Return After Crash'].iloc[-1]]}
df2 = pd.DataFrame(cumret, columns = ['Cumulative Returns 12/4-6/5', 'Cumulative Returns 12/4-2/20', 'Cumulative Returns 2/20-3/23', 'Cumulative Returns 3/23-6/5'], index= ['S&P 500','Apache','Baker','Cabot','Chevron','Concho','Conoco','Devon','Diamond','EOG','Exxon','Halliburton','Hess','Holly','Kinder','MarathonOil','MarathonPet','National','Noble','Occidental','Oneok','Phillips66','Pioneer','Schlumberger','Technip','Valero','Williams'])
pd.DataFrame(df2)
df2.sort_values('Cumulative Returns 3/23-6/5', ascending=False)
#Cumulative Returns Before Crash
spbef['Cumulative Return Before Crash'].plot(label="S&P 500")
apachebef['Cumulative Return Before Crash'].plot(label='Apache', figsize=(16,8), title = 'Cumulative Return of Energy Stocks Before Crash')
bakerbef['Cumulative Return Before Crash'].plot(label="Baker")
cabotbef['Cumulative Return Before Crash'].plot(label="Cabot")
chevronbef['Cumulative Return Before Crash'].plot(label="Chevron")
conchobef['Cumulative Return Before Crash'].plot(label="Concho")
conocobef['Cumulative Return Before Crash'].plot(label="Conoco")
devonbef['Cumulative Return Before Crash'].plot(label="Devon")
diamondbef['Cumulative Return Before Crash'].plot(label="Diamond")
EOGbef['Cumulative Return Before Crash'].plot(label="EOG")
exxonbef['Cumulative Return Before Crash'].plot(label="Exxon")
halliburtonbef['Cumulative Return Before Crash'].plot(label="Halliburton")
hessbef['Cumulative Return Before Crash'].plot(label="Hess")
hollybef['Cumulative Return Before Crash'].plot(label="Holly")
kinderbef['Cumulative Return Before Crash'].plot(label="Kinder")
marathonoilbef['Cumulative Return Before Crash'].plot(label="MarathonOil")
marathonpetbef['Cumulative Return Before Crash'].plot(label="MarathonPet")
nationalbef['Cumulative Return Before Crash'].plot(label="National")
noblebef['Cumulative Return Before Crash'].plot(label="Noble")
occidentalbef['Cumulative Return Before Crash'].plot(label="Occidental")
oneokbef['Cumulative Return Before Crash'].plot(label="Oneok")
phillips66bef['Cumulative Return Before Crash'].plot(label="Phillip66")
pioneerbef['Cumulative Return Before Crash'].plot(label="Pioneer")
schlumbergerbef['Cumulative Return Before Crash'].plot(label="Schlumberger")
technipbef['Cumulative Return Before Crash'].plot(label="Technip")
valerobef['Cumulative Return Before Crash'].plot(label="Valero")
williamsbef['Cumulative Return Before Crash'].plot(label="Williams")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Cumulative Returns During Crash
spdur['Cumulative Return During Crash'].plot(label="S&P 500")
apachedur['Cumulative Return During Crash'].plot(label='Apache', figsize=(16,8), title = 'Cumulative Return of Energy Stocks During Crash')
bakerdur['Cumulative Return During Crash'].plot(label="Baker")
cabotdur['Cumulative Return During Crash'].plot(label="Cabot")
chevrondur['Cumulative Return During Crash'].plot(label="Chevron")
conchodur['Cumulative Return During Crash'].plot(label="Concho")
conocodur['Cumulative Return During Crash'].plot(label="Conoco")
devondur['Cumulative Return During Crash'].plot(label="Devon")
diamonddur['Cumulative Return During Crash'].plot(label="Diamond")
EOGdur['Cumulative Return During Crash'].plot(label="EOG")
exxondur['Cumulative Return During Crash'].plot(label="Exxon")
halliburtondur['Cumulative Return During Crash'].plot(label="Halliburton")
hessdur['Cumulative Return During Crash'].plot(label="Hess")
hollydur['Cumulative Return During Crash'].plot(label="Holly")
kinderdur['Cumulative Return During Crash'].plot(label="Kinder")
marathonoildur['Cumulative Return During Crash'].plot(label="MarathonOil")
marathonpetdur['Cumulative Return During Crash'].plot(label="MarathonPet")
nationaldur['Cumulative Return During Crash'].plot(label="National")
nobledur['Cumulative Return During Crash'].plot(label="Noble")
occidentaldur['Cumulative Return During Crash'].plot(label="Occidental")
oneokdur['Cumulative Return During Crash'].plot(label="Oneok")
phillips66dur['Cumulative Return During Crash'].plot(label="Phillip66")
pioneerdur['Cumulative Return During Crash'].plot(label="Pioneer")
schlumbergerdur['Cumulative Return During Crash'].plot(label="Schlumberger")
technipdur['Cumulative Return During Crash'].plot(label="Technip")
valerodur['Cumulative Return During Crash'].plot(label="Valero")
williamsdur['Cumulative Return During Crash'].plot(label="Williams")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Cumulative Returns After Crash
spaft['Cumulative Return After Crash'].plot(label="S&P 500")
apacheaft['Cumulative Return After Crash'].plot(label='Apache', figsize=(16,8), title = 'Cumulative Return of Energy Stocks After Crash')
bakeraft['Cumulative Return After Crash'].plot(label="Baker")
cabotaft['Cumulative Return After Crash'].plot(label="Cabot")
chevronaft['Cumulative Return After Crash'].plot(label="Chevron")
conchoaft['Cumulative Return After Crash'].plot(label="Concho")
conocoaft['Cumulative Return After Crash'].plot(label="Conoco")
devonaft['Cumulative Return After Crash'].plot(label="Devon")
diamondaft['Cumulative Return After Crash'].plot(label="Diamond")
EOGaft['Cumulative Return After Crash'].plot(label="EOG")
exxonaft['Cumulative Return After Crash'].plot(label="Exxon")
halliburtonaft['Cumulative Return After Crash'].plot(label="Halliburton")
hessaft['Cumulative Return After Crash'].plot(label="Hess")
hollyaft['Cumulative Return After Crash'].plot(label="Holly")
kinderaft['Cumulative Return After Crash'].plot(label="Kinder")
marathonoilaft['Cumulative Return After Crash'].plot(label="MarathonOil")
marathonpetaft['Cumulative Return After Crash'].plot(label="MarathonPet")
nationalaft['Cumulative Return After Crash'].plot(label="National")
nobleaft['Cumulative Return After Crash'].plot(label="Noble")
occidentalaft['Cumulative Return After Crash'].plot(label="Occidental")
oneokaft['Cumulative Return After Crash'].plot(label="Oneok")
phillips66aft['Cumulative Return After Crash'].plot(label="Phillip66")
pioneeraft['Cumulative Return After Crash'].plot(label="Pioneer")
schlumbergeraft['Cumulative Return After Crash'].plot(label="Schlumberger")
technipaft['Cumulative Return After Crash'].plot(label="Technip")
valeroaft['Cumulative Return After Crash'].plot(label="Valero")
williamsaft['Cumulative Return After Crash'].plot(label="Williams")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Table of Key Statistics of Energy Stocks
import pandas as pd
import statistics as stats
means = [apachemean,bakermean,cabotmean,chevronmean,conchomean,conocomean,devonmean,diamondmean,EOGmean,exxonmean,halliburtonmean,hessmean,hollymean,kindermean,marathonoilmean,marathonpetmean,nationalmean,noblemean,occidentalmean,oneokmean,phillips66mean,pioneermean,schlumbergermean,technipmean,valeromean,williamsmean]
averagemean = stats.mean(means)
variances = [apachevar,bakervar,cabotvar,chevronvar,conchovar,conocovar,devonvar,diamondvar,EOGvar,exxonvar,halliburtonvar,hessvar,hollyvar,kindervar,marathonoilvar,marathonpetvar,nationalvar,noblevar,occidentalvar,oneokvar,phillips66var,pioneervar,schlumbergervar,technipvar,valerovar,williamsvar]
averagevar = stats.mean(variances)
kurtoses = [apachekurt,bakerkurt,cabotkurt,chevronkurt,conchokurt,conocokurt,devonkurt,diamondkurt,EOGkurt,exxonkurt,halliburtonkurt,hesskurt,hollykurt,kinderkurt,marathonoilkurt,marathonpetkurt,nationalkurt,noblekurt,occidentalkurt,oneokkurt,phillips66kurt,pioneerkurt,schlumbergerkurt,technipkurt,valerokurt,williamskurt]
averagekurt = stats.mean(kurtoses)
skews = [apacheskew,bakerskew,cabotskew,chevronskew,conchoskew,conocoskew,devonskew,diamondskew,EOGskew,exxonskew,halliburtonskew,hessskew,hollyskew,kinderskew,marathonoilskew,marathonpetskew,nationalskew,nobleskew,occidentalskew,oneokskew,phillips66skew,pioneerskew,schlumbergerskew,technipskew,valeroskew,williamsskew]
averageskew = stats.mean(skews)
Energy = {'Mean': [[spmean],[averagemean],[apachemean], [bakermean],[cabotmean],[chevronmean],[conchomean],[conocomean],[devonmean],[diamondmean],[EOGmean],[exxonmean],[halliburtonmean],[hessmean],[hollymean],[kindermean],[marathonoilmean],[marathonpetmean],[nationalmean],[noblemean],[occidentalmean],[oneokmean],[phillips66mean],[pioneermean],[schlumbergermean],[technipmean],[valeromean],[williamsmean]],
'Variance': [[spvar],[averagevar],[apachevar],[bakervar],[cabotvar],[chevronvar],[conchovar],[conocovar],[devonvar],[diamondvar],[EOGvar],[exxonvar],[halliburtonvar],[hessvar],[hollyvar],[kindervar],[marathonoilvar],[marathonpetvar],[nationalvar],[noblevar],[occidentalvar],[oneokvar],[phillips66var],[pioneervar],[schlumbergervar],[technipvar],[valerovar],[williamsvar]],
'Kurtosis': [[spkurt],[averagekurt],[apachekurt],[bakerkurt],[cabotkurt],[chevronkurt],[conchokurt],[conocokurt],[devonkurt],[diamondkurt],[EOGkurt],[exxonkurt],[halliburtonkurt],[hesskurt],[hollykurt],[kinderkurt],[marathonoilkurt],[marathonpetkurt],[nationalkurt],[noblekurt],[occidentalkurt],[oneokkurt],[phillips66kurt],[pioneerkurt],[schlumbergerkurt],[technipkurt],[valerokurt],[williamskurt]],
'Skew': [[spskew],[averageskew],[apacheskew],[bakerskew],[cabotskew],[chevronskew],[conchoskew],[conocoskew],[devonskew],[diamondskew],[EOGskew],[exxonskew],[halliburtonskew],[hessskew],[hollyskew],[kinderskew],[marathonoilskew],[marathonpetskew],[nationalskew],[nobleskew],[occidentalskew],[oneokskew],[phillips66skew],[pioneerskew],[schlumbergerskew],[technipskew],[valeroskew],[williamsskew]],
}
df = pd.DataFrame(Energy, columns = ['Mean', 'Variance', 'Kurtosis', 'Skew'], index= ['S&P 500','Average','Apache','Baker','Cabot','Chevron','Concho','Conoco','Devon','Diamond','EOG','Exxon','Halliburton','Hess','Holly','Kinder','MarathonOil','MarathonPet','National','Noble','Occidental','Oneok','Phillips66','Pioneer','Schlumberger','Technip','Valero','Williams']
)
pd.DataFrame(df)
df.sort_values("Mean", ascending=False)
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
APD = web.DataReader('APD', 'yahoo', start, end)
APD['returns'] = APD['Close'].pct_change(1)
APD['Cumulative Return'] = (1 + APD['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
APDmean = APD['returns'].mean()
APDvar = APD['returns'].var()
APDkurt = APD['returns'].kurt()
APDskew = APD['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
APDbef = web.DataReader('APD', 'yahoo', start, crashstart)
APDbef['avgreturnbefore'] = APDbef['Close'].pct_change(1)
APDbef['Cumulative Return Before Crash'] = (1 + APDbef['avgreturnbefore']).cumprod()
#period of crash
APDdur = web.DataReader('APD', 'yahoo', crashstart, crashend)
APDdur['avgreturnduring'] = APDdur['Close'].pct_change(1)
APDdur['Cumulative Return During Crash'] = (1 + APDdur['avgreturnduring']).cumprod()
#period after crash
APDaft = web.DataReader('APD', 'yahoo', crashend, end)
APDaft['avgreturnafter'] = APDaft['Close'].pct_change(1)
APDaft['Cumulative Return After Crash'] = (1 + APDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ALB = web.DataReader('ALB', 'yahoo', start, end)
ALB['returns'] = ALB['Close'].pct_change(1)
ALB['Cumulative Return'] = (1 + ALB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ALBmean = ALB['returns'].mean()
ALBvar = ALB['returns'].var()
ALBkurt = ALB['returns'].kurt()
ALBskew = ALB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ALBbef = web.DataReader('ALB', 'yahoo', start, crashstart)
ALBbef['avgreturnbefore'] = ALBbef['Close'].pct_change(1)
ALBbef['Cumulative Return Before Crash'] = (1 + ALBbef['avgreturnbefore']).cumprod()
#period of crash
ALBdur = web.DataReader('ALB', 'yahoo', crashstart, crashend)
ALBdur['avgreturnduring'] = ALBdur['Close'].pct_change(1)
ALBdur['Cumulative Return During Crash'] = (1 + ALBdur['avgreturnduring']).cumprod()
#period after crash
ALBaft = web.DataReader('ALB', 'yahoo', crashend, end)
ALBaft['avgreturnafter'] = ALBaft['Close'].pct_change(1)
ALBaft['Cumulative Return After Crash'] = (1 + ALBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AMCR = web.DataReader('AMCR', 'yahoo', start, end)
AMCR['returns'] = AMCR['Close'].pct_change(1)
AMCR['Cumulative Return'] = (1 + AMCR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AMCRmean = AMCR['returns'].mean()
AMCRvar = AMCR['returns'].var()
AMCRkurt = AMCR['returns'].kurt()
AMCRskew = AMCR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AMCRbef = web.DataReader('AMCR', 'yahoo', start, crashstart)
AMCRbef['avgreturnbefore'] = AMCRbef['Close'].pct_change(1)
AMCRbef['Cumulative Return Before Crash'] = (1 + AMCRbef['avgreturnbefore']).cumprod()
#period of crash
AMCRdur = web.DataReader('AMCR', 'yahoo', crashstart, crashend)
AMCRdur['avgreturnduring'] = AMCRdur['Close'].pct_change(1)
AMCRdur['Cumulative Return During Crash'] = (1 + AMCRdur['avgreturnduring']).cumprod()
#period after crash
AMCRaft = web.DataReader('AMCR', 'yahoo', crashend, end)
AMCRaft['avgreturnafter'] = AMCRaft['Close'].pct_change(1)
AMCRaft['Cumulative Return After Crash'] = (1 + AMCRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AVY = web.DataReader('AVY', 'yahoo', start, end)
AVY['returns'] = AVY['Close'].pct_change(1)
AVY['Cumulative Return'] = (1 + AVY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AVYmean = AVY['returns'].mean()
AVYvar = AVY['returns'].var()
AVYkurt = AVY['returns'].kurt()
AVYskew = AVY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AVYbef = web.DataReader('AVY', 'yahoo', start, crashstart)
AVYbef['avgreturnbefore'] = AVYbef['Close'].pct_change(1)
AVYbef['Cumulative Return Before Crash'] = (1 + AVYbef['avgreturnbefore']).cumprod()
#period of crash
AVYdur = web.DataReader('AVY', 'yahoo', crashstart, crashend)
AVYdur['avgreturnduring'] = AVYdur['Close'].pct_change(1)
AVYdur['Cumulative Return During Crash'] = (1 + AVYdur['avgreturnduring']).cumprod()
#period after crash
AVYaft = web.DataReader('AVY', 'yahoo', crashend, end)
AVYaft['avgreturnafter'] = AVYaft['Close'].pct_change(1)
AVYaft['Cumulative Return After Crash'] = (1 + AVYaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BLL = web.DataReader('BLL', 'yahoo', start, end)
BLL['returns'] = BLL['Close'].pct_change(1)
BLL['Cumulative Return'] = (1 + BLL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BLLmean = BLL['returns'].mean()
BLLvar = BLL['returns'].var()
BLLkurt = BLL['returns'].kurt()
BLLskew = BLL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BLLbef = web.DataReader('BLL', 'yahoo', start, crashstart)
BLLbef['avgreturnbefore'] = BLLbef['Close'].pct_change(1)
BLLbef['Cumulative Return Before Crash'] = (1 + BLLbef['avgreturnbefore']).cumprod()
#period of crash
BLLdur = web.DataReader('BLL', 'yahoo', crashstart, crashend)
BLLdur['avgreturnduring'] = BLLdur['Close'].pct_change(1)
BLLdur['Cumulative Return During Crash'] = (1 + BLLdur['avgreturnduring']).cumprod()
#period after crash
BLLaft = web.DataReader('BLL', 'yahoo', crashend, end)
BLLaft['avgreturnafter'] = BLLaft['Close'].pct_change(1)
BLLaft['Cumulative Return After Crash'] = (1 + BLLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CE = web.DataReader('CE', 'yahoo', start, end)
CE['returns'] = CE['Close'].pct_change(1)
CE['Cumulative Return'] = (1 + CE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CEmean = CE['returns'].mean()
CEvar = CE['returns'].var()
CEkurt = CE['returns'].kurt()
CEskew = CE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CEbef = web.DataReader('CE', 'yahoo', start, crashstart)
CEbef['avgreturnbefore'] = CEbef['Close'].pct_change(1)
CEbef['Cumulative Return Before Crash'] = (1 + CEbef['avgreturnbefore']).cumprod()
#period of crash
CEdur = web.DataReader('CE', 'yahoo', crashstart, crashend)
CEdur['avgreturnduring'] = CEdur['Close'].pct_change(1)
CEdur['Cumulative Return During Crash'] = (1 + CEdur['avgreturnduring']).cumprod()
#period after crash
CEaft = web.DataReader('CE', 'yahoo', crashend, end)
CEaft['avgreturnafter'] = CEaft['Close'].pct_change(1)
CEaft['Cumulative Return After Crash'] = (1 + CEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CF = web.DataReader('CF', 'yahoo', start, end)
CF['returns'] = CF['Close'].pct_change(1)
CF['Cumulative Return'] = (1 + CF['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CFmean = CF['returns'].mean()
CFvar = CF['returns'].var()
CFkurt = CF['returns'].kurt()
CFskew = CF['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CFbef = web.DataReader('CF', 'yahoo', start, crashstart)
CFbef['avgreturnbefore'] = CFbef['Close'].pct_change(1)
CFbef['Cumulative Return Before Crash'] = (1 + CFbef['avgreturnbefore']).cumprod()
#period of crash
CFdur = web.DataReader('CF', 'yahoo', crashstart, crashend)
CFdur['avgreturnduring'] = CFdur['Close'].pct_change(1)
CFdur['Cumulative Return During Crash'] = (1 + CFdur['avgreturnduring']).cumprod()
#period after crash
CFaft = web.DataReader('CF', 'yahoo', crashend, end)
CFaft['avgreturnafter'] = CFaft['Close'].pct_change(1)
CFaft['Cumulative Return After Crash'] = (1 + CFaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CTVA = web.DataReader('CTVA', 'yahoo', start, end)
CTVA['returns'] = CTVA['Close'].pct_change(1)
CTVA['Cumulative Return'] = (1 + CTVA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CTVAmean = CTVA['returns'].mean()
CTVAvar = CTVA['returns'].var()
CTVAkurt = CTVA['returns'].kurt()
CTVAskew = CTVA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CTVAbef = web.DataReader('CTVA', 'yahoo', start, crashstart)
CTVAbef['avgreturnbefore'] = CTVAbef['Close'].pct_change(1)
CTVAbef['Cumulative Return Before Crash'] = (1 + CTVAbef['avgreturnbefore']).cumprod()
#period of crash
CTVAdur = web.DataReader('CTVA', 'yahoo', crashstart, crashend)
CTVAdur['avgreturnduring'] = CTVAdur['Close'].pct_change(1)
CTVAdur['Cumulative Return During Crash'] = (1 + CTVAdur['avgreturnduring']).cumprod()
#period after crash
CTVAaft = web.DataReader('CTVA', 'yahoo', crashend, end)
CTVAaft['avgreturnafter'] = CTVAaft['Close'].pct_change(1)
CTVAaft['Cumulative Return After Crash'] = (1 + CTVAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DOW = web.DataReader('DOW', 'yahoo', start, end)
DOW['returns'] = DOW['Close'].pct_change(1)
DOW['Cumulative Return'] = (1 + DOW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DOWmean = DOW['returns'].mean()
DOWvar = DOW['returns'].var()
DOWkurt = DOW['returns'].kurt()
DOWskew = DOW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DOWbef = web.DataReader('DOW', 'yahoo', start, crashstart)
DOWbef['avgreturnbefore'] = DOWbef['Close'].pct_change(1)
DOWbef['Cumulative Return Before Crash'] = (1 + DOWbef['avgreturnbefore']).cumprod()
#period of crash
DOWdur = web.DataReader('DOW', 'yahoo', crashstart, crashend)
DOWdur['avgreturnduring'] = DOWdur['Close'].pct_change(1)
DOWdur['Cumulative Return During Crash'] = (1 + DOWdur['avgreturnduring']).cumprod()
#period after crash
DOWaft = web.DataReader('DOW', 'yahoo', crashend, end)
DOWaft['avgreturnafter'] = DOWaft['Close'].pct_change(1)
DOWaft['Cumulative Return After Crash'] = (1 + DOWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DD = web.DataReader('DD', 'yahoo', start, end)
DD['returns'] = DD['Close'].pct_change(1)
DD['Cumulative Return'] = (1 + DD['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DDmean = DD['returns'].mean()
DDvar = DD['returns'].var()
DDkurt = DD['returns'].kurt()
DDskew = DD['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DDbef = web.DataReader('DD', 'yahoo', start, crashstart)
DDbef['avgreturnbefore'] = DDbef['Close'].pct_change(1)
DDbef['Cumulative Return Before Crash'] = (1 + DDbef['avgreturnbefore']).cumprod()
#period of crash
DDdur = web.DataReader('DD', 'yahoo', crashstart, crashend)
DDdur['avgreturnduring'] = DDdur['Close'].pct_change(1)
DDdur['Cumulative Return During Crash'] = (1 + DDdur['avgreturnduring']).cumprod()
#period after crash
DDaft = web.DataReader('DD', 'yahoo', crashend, end)
DDaft['avgreturnafter'] = DDaft['Close'].pct_change(1)
DDaft['Cumulative Return After Crash'] = (1 + DDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EMN = web.DataReader('EMN', 'yahoo', start, end)
EMN['returns'] = EMN['Close'].pct_change(1)
EMN['Cumulative Return'] = (1 + EMN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EMNmean = EMN['returns'].mean()
EMNvar = EMN['returns'].var()
EMNkurt = EMN['returns'].kurt()
EMNskew = EMN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EMNbef = web.DataReader('EMN', 'yahoo', start, crashstart)
EMNbef['avgreturnbefore'] = EMNbef['Close'].pct_change(1)
EMNbef['Cumulative Return Before Crash'] = (1 + EMNbef['avgreturnbefore']).cumprod()
#period of crash
EMNdur = web.DataReader('EMN', 'yahoo', crashstart, crashend)
EMNdur['avgreturnduring'] = EMNdur['Close'].pct_change(1)
EMNdur['Cumulative Return During Crash'] = (1 + EMNdur['avgreturnduring']).cumprod()
#period after crash
EMNaft = web.DataReader('EMN', 'yahoo', crashend, end)
EMNaft['avgreturnafter'] = EMNaft['Close'].pct_change(1)
EMNaft['Cumulative Return After Crash'] = (1 + EMNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ECL = web.DataReader('ECL', 'yahoo', start, end)
ECL['returns'] = ECL['Close'].pct_change(1)
ECL['Cumulative Return'] = (1 + ECL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ECLmean = ECL['returns'].mean()
ECLvar = ECL['returns'].var()
ECLkurt = ECL['returns'].kurt()
ECLskew = ECL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ECLbef = web.DataReader('ECL', 'yahoo', start, crashstart)
ECLbef['avgreturnbefore'] = ECLbef['Close'].pct_change(1)
ECLbef['Cumulative Return Before Crash'] = (1 + ECLbef['avgreturnbefore']).cumprod()
#period of crash
ECLdur = web.DataReader('ECL', 'yahoo', crashstart, crashend)
ECLdur['avgreturnduring'] = ECLdur['Close'].pct_change(1)
ECLdur['Cumulative Return During Crash'] = (1 + ECLdur['avgreturnduring']).cumprod()
#period after crash
ECLaft = web.DataReader('ECL', 'yahoo', crashend, end)
ECLaft['avgreturnafter'] = ECLaft['Close'].pct_change(1)
ECLaft['Cumulative Return After Crash'] = (1 + ECLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FMC = web.DataReader('FMC', 'yahoo', start, end)
FMC['returns'] = FMC['Close'].pct_change(1)
FMC['Cumulative Return'] = (1 + FMC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FMCmean = FMC['returns'].mean()
FMCvar = FMC['returns'].var()
FMCkurt = FMC['returns'].kurt()
FMCskew = FMC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FMCbef = web.DataReader('FMC', 'yahoo', start, crashstart)
FMCbef['avgreturnbefore'] = FMCbef['Close'].pct_change(1)
FMCbef['Cumulative Return Before Crash'] = (1 + FMCbef['avgreturnbefore']).cumprod()
#period of crash
FMCdur = web.DataReader('FMC', 'yahoo', crashstart, crashend)
FMCdur['avgreturnduring'] = FMCdur['Close'].pct_change(1)
FMCdur['Cumulative Return During Crash'] = (1 + FMCdur['avgreturnduring']).cumprod()
#period after crash
FMCaft = web.DataReader('FMC', 'yahoo', crashend, end)
FMCaft['avgreturnafter'] = FMCaft['Close'].pct_change(1)
FMCaft['Cumulative Return After Crash'] = (1 + FMCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FCX = web.DataReader('FCX', 'yahoo', start, end)
FCX['returns'] = FCX['Close'].pct_change(1)
FCX['Cumulative Return'] = (1 + FCX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FCXmean = FCX['returns'].mean()
FCXvar = FCX['returns'].var()
FCXkurt = FCX['returns'].kurt()
FCXskew = FCX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FCXbef = web.DataReader('FCX', 'yahoo', start, crashstart)
FCXbef['avgreturnbefore'] = FCXbef['Close'].pct_change(1)
FCXbef['Cumulative Return Before Crash'] = (1 + FCXbef['avgreturnbefore']).cumprod()
#period of crash
FCXdur = web.DataReader('FCX', 'yahoo', crashstart, crashend)
FCXdur['avgreturnduring'] = FCXdur['Close'].pct_change(1)
FCXdur['Cumulative Return During Crash'] = (1 + FCXdur['avgreturnduring']).cumprod()
#period after crash
FCXaft = web.DataReader('FCX', 'yahoo', crashend, end)
FCXaft['avgreturnafter'] = FCXaft['Close'].pct_change(1)
FCXaft['Cumulative Return After Crash'] = (1 + FCXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
IP = web.DataReader('IP', 'yahoo', start, end)
IP['returns'] = IP['Close'].pct_change(1)
IP['Cumulative Return'] = (1 + IP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
IPmean = IP['returns'].mean()
IPvar = IP['returns'].var()
IPkurt = IP['returns'].kurt()
IPskew = IP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
IPbef = web.DataReader('IP', 'yahoo', start, crashstart)
IPbef['avgreturnbefore'] = IPbef['Close'].pct_change(1)
IPbef['Cumulative Return Before Crash'] = (1 + IPbef['avgreturnbefore']).cumprod()
#period of crash
IPdur = web.DataReader('IP', 'yahoo', crashstart, crashend)
IPdur['avgreturnduring'] = IPdur['Close'].pct_change(1)
IPdur['Cumulative Return During Crash'] = (1 + IPdur['avgreturnduring']).cumprod()
#period after crash
IPaft = web.DataReader('IP', 'yahoo', crashend, end)
IPaft['avgreturnafter'] = IPaft['Close'].pct_change(1)
IPaft['Cumulative Return After Crash'] = (1 + IPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
IFF = web.DataReader('IFF', 'yahoo', start, end)
IFF['returns'] = IFF['Close'].pct_change(1)
IFF['Cumulative Return'] = (1 + IFF['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
IFFmean = IFF['returns'].mean()
IFFvar = IFF['returns'].var()
IFFkurt = IFF['returns'].kurt()
IFFskew = IFF['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
IFFbef = web.DataReader('IFF', 'yahoo', start, crashstart)
IFFbef['avgreturnbefore'] = IFFbef['Close'].pct_change(1)
IFFbef['Cumulative Return Before Crash'] = (1 + IFFbef['avgreturnbefore']).cumprod()
#period of crash
IFFdur = web.DataReader('IFF', 'yahoo', crashstart, crashend)
IFFdur['avgreturnduring'] = IFFdur['Close'].pct_change(1)
IFFdur['Cumulative Return During Crash'] = (1 + IFFdur['avgreturnduring']).cumprod()
#period after crash
IFFaft = web.DataReader('IFF', 'yahoo', crashend, end)
IFFaft['avgreturnafter'] = IFFaft['Close'].pct_change(1)
IFFaft['Cumulative Return After Crash'] = (1 + IFFaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LIN = web.DataReader('LIN', 'yahoo', start, end)
LIN['returns'] = LIN['Close'].pct_change(1)
LIN['Cumulative Return'] = (1 + LIN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LINmean = LIN['returns'].mean()
LINvar = LIN['returns'].var()
LINkurt = LIN['returns'].kurt()
LINskew = LIN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LINbef = web.DataReader('LIN', 'yahoo', start, crashstart)
LINbef['avgreturnbefore'] = LINbef['Close'].pct_change(1)
LINbef['Cumulative Return Before Crash'] = (1 + LINbef['avgreturnbefore']).cumprod()
#period of crash
LINdur = web.DataReader('LIN', 'yahoo', crashstart, crashend)
LINdur['avgreturnduring'] = LINdur['Close'].pct_change(1)
LINdur['Cumulative Return During Crash'] = (1 + LINdur['avgreturnduring']).cumprod()
#period after crash
LINaft = web.DataReader('LIN', 'yahoo', crashend, end)
LINaft['avgreturnafter'] = LINaft['Close'].pct_change(1)
LINaft['Cumulative Return After Crash'] = (1 + LINaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LYB = web.DataReader('LYB', 'yahoo', start, end)
LYB['returns'] = LYB['Close'].pct_change(1)
LYB['Cumulative Return'] = (1 + LYB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LYBmean = LYB['returns'].mean()
LYBvar = LYB['returns'].var()
LYBkurt = LYB['returns'].kurt()
LYBskew = LYB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LYBbef = web.DataReader('LYB', 'yahoo', start, crashstart)
LYBbef['avgreturnbefore'] = LYBbef['Close'].pct_change(1)
LYBbef['Cumulative Return Before Crash'] = (1 + LYBbef['avgreturnbefore']).cumprod()
#period of crash
LYBdur = web.DataReader('LYB', 'yahoo', crashstart, crashend)
LYBdur['avgreturnduring'] = LYBdur['Close'].pct_change(1)
LYBdur['Cumulative Return During Crash'] = (1 + LYBdur['avgreturnduring']).cumprod()
#period after crash
LYBaft = web.DataReader('LYB', 'yahoo', crashend, end)
LYBaft['avgreturnafter'] = LYBaft['Close'].pct_change(1)
LYBaft['Cumulative Return After Crash'] = (1 + LYBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MLM = web.DataReader('MLM', 'yahoo', start, end)
MLM['returns'] = MLM['Close'].pct_change(1)
MLM['Cumulative Return'] = (1 + MLM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MLMmean = MLM['returns'].mean()
MLMvar = MLM['returns'].var()
MLMkurt = MLM['returns'].kurt()
MLMskew = MLM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MLMbef = web.DataReader('MLM', 'yahoo', start, crashstart)
MLMbef['avgreturnbefore'] = MLMbef['Close'].pct_change(1)
MLMbef['Cumulative Return Before Crash'] = (1 + MLMbef['avgreturnbefore']).cumprod()
#period of crash
MLMdur = web.DataReader('MLM', 'yahoo', crashstart, crashend)
MLMdur['avgreturnduring'] = MLMdur['Close'].pct_change(1)
MLMdur['Cumulative Return During Crash'] = (1 + MLMdur['avgreturnduring']).cumprod()
#period after crash
MLMaft = web.DataReader('MLM', 'yahoo', crashend, end)
MLMaft['avgreturnafter'] = MLMaft['Close'].pct_change(1)
MLMaft['Cumulative Return After Crash'] = (1 + MLMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MOS = web.DataReader('MOS', 'yahoo', start, end)
MOS['returns'] = MOS['Close'].pct_change(1)
MOS['Cumulative Return'] = (1 + MOS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MOSmean = MOS['returns'].mean()
MOSvar = MOS['returns'].var()
MOSkurt = MOS['returns'].kurt()
MOSskew = MOS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MOSbef = web.DataReader('MOS', 'yahoo', start, crashstart)
MOSbef['avgreturnbefore'] = MOSbef['Close'].pct_change(1)
MOSbef['Cumulative Return Before Crash'] = (1 + MOSbef['avgreturnbefore']).cumprod()
#period of crash
MOSdur = web.DataReader('MOS', 'yahoo', crashstart, crashend)
MOSdur['avgreturnduring'] = MOSdur['Close'].pct_change(1)
MOSdur['Cumulative Return During Crash'] = (1 + MOSdur['avgreturnduring']).cumprod()
#period after crash
MOSaft = web.DataReader('MOS', 'yahoo', crashend, end)
MOSaft['avgreturnafter'] = MOSaft['Close'].pct_change(1)
MOSaft['Cumulative Return After Crash'] = (1 + MOSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NEM = web.DataReader('NEM', 'yahoo', start, end)
NEM['returns'] = NEM['Close'].pct_change(1)
NEM['Cumulative Return'] = (1 + NEM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NEMmean = NEM['returns'].mean()
NEMvar = NEM['returns'].var()
NEMkurt = NEM['returns'].kurt()
NEMskew = NEM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NEMbef = web.DataReader('NEM', 'yahoo', start, crashstart)
NEMbef['avgreturnbefore'] = NEMbef['Close'].pct_change(1)
NEMbef['Cumulative Return Before Crash'] = (1 + NEMbef['avgreturnbefore']).cumprod()
#period of crash
NEMdur = web.DataReader('NEM', 'yahoo', crashstart, crashend)
NEMdur['avgreturnduring'] = NEMdur['Close'].pct_change(1)
NEMdur['Cumulative Return During Crash'] = (1 + NEMdur['avgreturnduring']).cumprod()
#period after crash
NEMaft = web.DataReader('NEM', 'yahoo', crashend, end)
NEMaft['avgreturnafter'] = NEMaft['Close'].pct_change(1)
NEMaft['Cumulative Return After Crash'] = (1 + NEMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NUE = web.DataReader('NUE', 'yahoo', start, end)
NUE['returns'] = NUE['Close'].pct_change(1)
NUE['Cumulative Return'] = (1 + NUE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NUEmean = NUE['returns'].mean()
NUEvar = NUE['returns'].var()
NUEkurt = NUE['returns'].kurt()
NUEskew = NUE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NUEbef = web.DataReader('NUE', 'yahoo', start, crashstart)
NUEbef['avgreturnbefore'] = NUEbef['Close'].pct_change(1)
NUEbef['Cumulative Return Before Crash'] = (1 + NUEbef['avgreturnbefore']).cumprod()
#period of crash
NUEdur = web.DataReader('NUE', 'yahoo', crashstart, crashend)
NUEdur['avgreturnduring'] = NUEdur['Close'].pct_change(1)
NUEdur['Cumulative Return During Crash'] = (1 + NUEdur['avgreturnduring']).cumprod()
#period after crash
NUEaft = web.DataReader('NUE', 'yahoo', crashend, end)
NUEaft['avgreturnafter'] = NUEaft['Close'].pct_change(1)
NUEaft['Cumulative Return After Crash'] = (1 + NUEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PKG = web.DataReader('PKG', 'yahoo', start, end)
PKG['returns'] = PKG['Close'].pct_change(1)
PKG['Cumulative Return'] = (1 + PKG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PKGmean = PKG['returns'].mean()
PKGvar = PKG['returns'].var()
PKGkurt = PKG['returns'].kurt()
PKGskew = PKG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PKGbef = web.DataReader('PKG', 'yahoo', start, crashstart)
PKGbef['avgreturnbefore'] = PKGbef['Close'].pct_change(1)
PKGbef['Cumulative Return Before Crash'] = (1 + PKGbef['avgreturnbefore']).cumprod()
#period of crash
PKGdur = web.DataReader('PKG', 'yahoo', crashstart, crashend)
PKGdur['avgreturnduring'] = PKGdur['Close'].pct_change(1)
PKGdur['Cumulative Return During Crash'] = (1 + PKGdur['avgreturnduring']).cumprod()
#period after crash
PKGaft = web.DataReader('PKG', 'yahoo', crashend, end)
PKGaft['avgreturnafter'] = PKGaft['Close'].pct_change(1)
PKGaft['Cumulative Return After Crash'] = (1 + PKGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PPG = web.DataReader('PPG', 'yahoo', start, end)
PPG['returns'] = PPG['Close'].pct_change(1)
PPG['Cumulative Return'] = (1 + PPG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PPGmean = PPG['returns'].mean()
PPGvar = PPG['returns'].var()
PPGkurt = PPG['returns'].kurt()
PPGskew = PPG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PPGbef = web.DataReader('PPG', 'yahoo', start, crashstart)
PPGbef['avgreturnbefore'] = PPGbef['Close'].pct_change(1)
PPGbef['Cumulative Return Before Crash'] = (1 + PPGbef['avgreturnbefore']).cumprod()
#period of crash
PPGdur = web.DataReader('PPG', 'yahoo', crashstart, crashend)
PPGdur['avgreturnduring'] = PPGdur['Close'].pct_change(1)
PPGdur['Cumulative Return During Crash'] = (1 + PPGdur['avgreturnduring']).cumprod()
#period after crash
PPGaft = web.DataReader('PPG', 'yahoo', crashend, end)
PPGaft['avgreturnafter'] = PPGaft['Close'].pct_change(1)
PPGaft['Cumulative Return After Crash'] = (1 + PPGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SEE = web.DataReader('SEE', 'yahoo', start, end)
SEE['returns'] = SEE['Close'].pct_change(1)
SEE['Cumulative Return'] = (1 + SEE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SEEmean = SEE['returns'].mean()
SEEvar = SEE['returns'].var()
SEEkurt = SEE['returns'].kurt()
SEEskew = SEE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SEEbef = web.DataReader('SEE', 'yahoo', start, crashstart)
SEEbef['avgreturnbefore'] = SEEbef['Close'].pct_change(1)
SEEbef['Cumulative Return Before Crash'] = (1 + SEEbef['avgreturnbefore']).cumprod()
#period of crash
SEEdur = web.DataReader('SEE', 'yahoo', crashstart, crashend)
SEEdur['avgreturnduring'] = SEEdur['Close'].pct_change(1)
SEEdur['Cumulative Return During Crash'] = (1 + SEEdur['avgreturnduring']).cumprod()
#period after crash
SEEaft = web.DataReader('SEE', 'yahoo', crashend, end)
SEEaft['avgreturnafter'] = SEEaft['Close'].pct_change(1)
SEEaft['Cumulative Return After Crash'] = (1 + SEEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SHW = web.DataReader('SHW', 'yahoo', start, end)
SHW['returns'] = SHW['Close'].pct_change(1)
SHW['Cumulative Return'] = (1 + SHW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SHWmean = SHW['returns'].mean()
SHWvar = SHW['returns'].var()
SHWkurt = SHW['returns'].kurt()
SHWskew = SHW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SHWbef = web.DataReader('SHW', 'yahoo', start, crashstart)
SHWbef['avgreturnbefore'] = SHWbef['Close'].pct_change(1)
SHWbef['Cumulative Return Before Crash'] = (1 + SHWbef['avgreturnbefore']).cumprod()
#period of crash
SHWdur = web.DataReader('SHW', 'yahoo', crashstart, crashend)
SHWdur['avgreturnduring'] = SHWdur['Close'].pct_change(1)
SHWdur['Cumulative Return During Crash'] = (1 + SHWdur['avgreturnduring']).cumprod()
#period after crash
SHWaft = web.DataReader('SHW', 'yahoo', crashend, end)
SHWaft['avgreturnafter'] = SHWaft['Close'].pct_change(1)
SHWaft['Cumulative Return After Crash'] = (1 + SHWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
VMC = web.DataReader('VMC', 'yahoo', start, end)
VMC['returns'] = VMC['Close'].pct_change(1)
VMC['Cumulative Return'] = (1 + VMC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
VMCmean = VMC['returns'].mean()
VMCvar = VMC['returns'].var()
VMCkurt = VMC['returns'].kurt()
VMCskew = VMC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
VMCbef = web.DataReader('VMC', 'yahoo', start, crashstart)
VMCbef['avgreturnbefore'] = VMCbef['Close'].pct_change(1)
VMCbef['Cumulative Return Before Crash'] = (1 + VMCbef['avgreturnbefore']).cumprod()
#period of crash
VMCdur = web.DataReader('VMC', 'yahoo', crashstart, crashend)
VMCdur['avgreturnduring'] = VMCdur['Close'].pct_change(1)
VMCdur['Cumulative Return During Crash'] = (1 + VMCdur['avgreturnduring']).cumprod()
#period after crash
VMCaft = web.DataReader('VMC', 'yahoo', crashend, end)
VMCaft['avgreturnafter'] = VMCaft['Close'].pct_change(1)
VMCaft['Cumulative Return After Crash'] = (1 + VMCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WRK = web.DataReader('WRK', 'yahoo', start, end)
WRK['returns'] = WRK['Close'].pct_change(1)
WRK['Cumulative Return'] = (1 + WRK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WRKmean = WRK['returns'].mean()
WRKvar = WRK['returns'].var()
WRKkurt = WRK['returns'].kurt()
WRKskew = WRK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WRKbef = web.DataReader('WRK', 'yahoo', start, crashstart)
WRKbef['avgreturnbefore'] = WRKbef['Close'].pct_change(1)
WRKbef['Cumulative Return Before Crash'] = (1 + WRKbef['avgreturnbefore']).cumprod()
#period of crash
WRKdur = web.DataReader('WRK', 'yahoo', crashstart, crashend)
WRKdur['avgreturnduring'] = WRKdur['Close'].pct_change(1)
WRKdur['Cumulative Return During Crash'] = (1 + WRKdur['avgreturnduring']).cumprod()
#period after crash
WRKaft = web.DataReader('WRK', 'yahoo', crashend, end)
WRKaft['avgreturnafter'] = WRKaft['Close'].pct_change(1)
WRKaft['Cumulative Return After Crash'] = (1 + WRKaft['avgreturnafter']).cumprod()
#KDE Plot for Materials Sector
sp['returns'].plot(kind = 'kde', label ='S&P 500', alpha=0.5)
APD['returns'].plot(kind = 'kde', label ='APD', figsize = (10,8), alpha=0.5, title = 'KDE of Materials Stocks')
ALB['returns'].plot(kind = 'kde', label ='ALB', alpha=0.5)
AMCR['returns'].plot(kind = 'kde', label ='AMCR', alpha=0.5)
AVY['returns'].plot(kind = 'kde', label ='AVY', alpha=0.5)
BLL['returns'].plot(kind = 'kde', label ='BLL', alpha=0.5)
CE['returns'].plot(kind = 'kde', label ='CE', alpha=0.5)
CF['returns'].plot(kind = 'kde', label ='CF', alpha=0.5)
CTVA['returns'].plot(kind = 'kde', label ='CTVA', alpha=0.5)
DOW['returns'].plot(kind = 'kde', label ='DOW', alpha=0.5)
DD['returns'].plot(kind = 'kde', label ='DD', alpha=0.5)
EMN['returns'].plot(kind = 'kde', label ='EMN', alpha=0.5)
ECL['returns'].plot(kind = 'kde', label ='ECL', alpha=0.5)
FMC['returns'].plot(kind = 'kde', label ='FMC', alpha=0.5)
FCX['returns'].plot(kind = 'kde', label ='FCX', alpha=0.5)
IP['returns'].plot(kind = 'kde', label ='IP', alpha=0.5)
IFF['returns'].plot(kind = 'kde', label ='IFF', alpha=0.5)
LIN['returns'].plot(kind = 'kde', label ='LIN', alpha=0.5)
LYB['returns'].plot(kind = 'kde', label ='LYB', alpha=0.5)
MLM['returns'].plot(kind = 'kde', label ='MLM', alpha=0.5)
MOS['returns'].plot(kind = 'kde', label ='MOS', alpha=0.5)
NEM['returns'].plot(kind = 'kde', label ='NEM', alpha=0.5)
NUE['returns'].plot(kind = 'kde', label ='NUE', alpha=0.5)
PKG['returns'].plot(kind = 'kde', label ='PKG', alpha=0.5)
PPG['returns'].plot(kind = 'kde', label ='PPG', alpha=0.5)
SEE['returns'].plot(kind = 'kde', label ='SEE', alpha=0.5)
SHW['returns'].plot(kind = 'kde', label ='SHW', alpha=0.5)
VMC['returns'].plot(kind = 'kde', label ='VMC', alpha=0.5)
WRK['returns'].plot(kind = 'kde', label ='WRK', alpha=0.5)
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Boxplots comparing returns for Materials Sector
box_df = pd.concat([sp['returns'],APD['returns'],ALB['returns'],AMCR['returns'],AVY['returns'],BLL['returns'],CE['returns'],CF['returns'],CTVA['returns'],DOW['returns'],DD['returns'],EMN['returns'],ECL['returns'],FMC['returns'],FCX['returns'],IP['returns'],IFF['returns'],LIN['returns'],LYB['returns'],MLM['returns'],MOS['returns'],NEM['returns'],NUE['returns'],PKG['returns'],PPG['returns'],SEE['returns'],SHW['returns'],VMC['returns'],WRK['returns']], axis=1)
box_df.columns = ['S&P 500','APD','ALB','AMCR','AVY','BLL','CE','CF','CTVA','DOW','DD','EMN','ECL','FMC','FCX','IP','IFF','LIN','LYB','MLM','MOS','NEM','NUE','PKG','PPG','SEE','SHW','VMC','WRK']
box_df.plot(kind='box', figsize=(30,10), colormap= 'jet', title = 'Boxplots of Materials Sector Returns')
#Cumulative Returns of Materials Stocks for Whole period
sp['Cumulative Return'].plot(label="S&P 500")
APD['Cumulative Return'].plot(label='APD', figsize=(16,8), title = 'Cumulative Return of Materials Stocks')
ALB['Cumulative Return'].plot(label="ALB")
AMCR['Cumulative Return'].plot(label="AMCR")
AVY['Cumulative Return'].plot(label="AVY")
BLL['Cumulative Return'].plot(label="BLL")
CE['Cumulative Return'].plot(label="CE")
CF['Cumulative Return'].plot(label="CF")
CTVA['Cumulative Return'].plot(label="CTVA")
DOW['Cumulative Return'].plot(label="DOW")
DD['Cumulative Return'].plot(label="DD")
EMN['Cumulative Return'].plot(label="EMN")
ECL['Cumulative Return'].plot(label="ECL")
FMC['Cumulative Return'].plot(label="FMC")
FCX['Cumulative Return'].plot(label="FCX")
IP['Cumulative Return'].plot(label="IP")
IFF['Cumulative Return'].plot(label="IFF")
LIN['Cumulative Return'].plot(label="LIN")
LYB['Cumulative Return'].plot(label="LYB")
MLM['Cumulative Return'].plot(label="MLM")
MOS['Cumulative Return'].plot(label="MOS")
NEM['Cumulative Return'].plot(label="NEM")
NUE['Cumulative Return'].plot(label="NUE")
PKG['Cumulative Return'].plot(label="PKG")
PPG['Cumulative Return'].plot(label="PPG")
SEE['Cumulative Return'].plot(label="SEE")
SHW['Cumulative Return'].plot(label="SHW")
VMC['Cumulative Return'].plot(label="VMC")
WRK['Cumulative Return'].plot(label="WRK")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Sorting by Cumulative Return
cumret = {'Cumulative Returns 12/4-6/5': [sp['Cumulative Return'].iloc[-1],APD['Cumulative Return'].iloc[-1],ALB['Cumulative Return'].iloc[-1],AMCR['Cumulative Return'].iloc[-1],AVY['Cumulative Return'].iloc[-1],BLL['Cumulative Return'].iloc[-1],CE['Cumulative Return'].iloc[-1],CF['Cumulative Return'].iloc[-1],CTVA['Cumulative Return'].iloc[-1],DOW['Cumulative Return'].iloc[-1],DD['Cumulative Return'].iloc[-1],EMN['Cumulative Return'].iloc[-1],ECL['Cumulative Return'].iloc[-1],FMC['Cumulative Return'].iloc[-1],FCX['Cumulative Return'].iloc[-1],IP['Cumulative Return'].iloc[-1],IFF['Cumulative Return'].iloc[-1],LIN['Cumulative Return'].iloc[-1],LYB['Cumulative Return'].iloc[-1],MLM['Cumulative Return'].iloc[-1],MOS['Cumulative Return'].iloc[-1],NEM['Cumulative Return'].iloc[-1],NUE['Cumulative Return'].iloc[-1],PKG['Cumulative Return'].iloc[-1],PPG['Cumulative Return'].iloc[-1],SEE['Cumulative Return'].iloc[-1],SHW['Cumulative Return'].iloc[-1],VMC['Cumulative Return'].iloc[-1],WRK['Cumulative Return'].iloc[-1]],
'Cumulative Returns 12/4-2/20': [spbef['Cumulative Return Before Crash'].iloc[-1],APDbef['Cumulative Return Before Crash'].iloc[-1],ALBbef['Cumulative Return Before Crash'].iloc[-1],AMCRbef['Cumulative Return Before Crash'].iloc[-1],AVYbef['Cumulative Return Before Crash'].iloc[-1],BLLbef['Cumulative Return Before Crash'].iloc[-1],CEbef['Cumulative Return Before Crash'].iloc[-1],CFbef['Cumulative Return Before Crash'].iloc[-1],CTVAbef['Cumulative Return Before Crash'].iloc[-1],DOWbef['Cumulative Return Before Crash'].iloc[-1],DDbef['Cumulative Return Before Crash'].iloc[-1],EMNbef['Cumulative Return Before Crash'].iloc[-1],ECLbef['Cumulative Return Before Crash'].iloc[-1],FMCbef['Cumulative Return Before Crash'].iloc[-1],FCXbef['Cumulative Return Before Crash'].iloc[-1],IPbef['Cumulative Return Before Crash'].iloc[-1],IFFbef['Cumulative Return Before Crash'].iloc[-1],LINbef['Cumulative Return Before Crash'].iloc[-1],LYBbef['Cumulative Return Before Crash'].iloc[-1],MLMbef['Cumulative Return Before Crash'].iloc[-1],MOSbef['Cumulative Return Before Crash'].iloc[-1],NEMbef['Cumulative Return Before Crash'].iloc[-1],NUEbef['Cumulative Return Before Crash'].iloc[-1],PKGbef['Cumulative Return Before Crash'].iloc[-1],PPGbef['Cumulative Return Before Crash'].iloc[-1],SEEbef['Cumulative Return Before Crash'].iloc[-1],SHWbef['Cumulative Return Before Crash'].iloc[-1],VMCbef['Cumulative Return Before Crash'].iloc[-1],WRKbef['Cumulative Return Before Crash'].iloc[-1]],
'Cumulative Returns 2/20-3/23': [spdur['Cumulative Return During Crash'].iloc[-1],APDdur['Cumulative Return During Crash'].iloc[-1],ALBdur['Cumulative Return During Crash'].iloc[-1],AMCRdur['Cumulative Return During Crash'].iloc[-1],AVYdur['Cumulative Return During Crash'].iloc[-1],BLLdur['Cumulative Return During Crash'].iloc[-1],CEdur['Cumulative Return During Crash'].iloc[-1],CFdur['Cumulative Return During Crash'].iloc[-1],CTVAdur['Cumulative Return During Crash'].iloc[-1],DOWdur['Cumulative Return During Crash'].iloc[-1],DDdur['Cumulative Return During Crash'].iloc[-1],EMNdur['Cumulative Return During Crash'].iloc[-1],ECLdur['Cumulative Return During Crash'].iloc[-1],FMCdur['Cumulative Return During Crash'].iloc[-1],FCXdur['Cumulative Return During Crash'].iloc[-1],IPdur['Cumulative Return During Crash'].iloc[-1],IFFdur['Cumulative Return During Crash'].iloc[-1],LINdur['Cumulative Return During Crash'].iloc[-1],LYBdur['Cumulative Return During Crash'].iloc[-1],MLMdur['Cumulative Return During Crash'].iloc[-1],MOSdur['Cumulative Return During Crash'].iloc[-1],NEMdur['Cumulative Return During Crash'].iloc[-1],NUEdur['Cumulative Return During Crash'].iloc[-1],PKGdur['Cumulative Return During Crash'].iloc[-1],PPGdur['Cumulative Return During Crash'].iloc[-1],SEEdur['Cumulative Return During Crash'].iloc[-1],SHWdur['Cumulative Return During Crash'].iloc[-1],VMCdur['Cumulative Return During Crash'].iloc[-1],WRKdur['Cumulative Return During Crash'].iloc[-1]],
'Cumulative Returns 3/23-6/5': [spaft['Cumulative Return After Crash'].iloc[-1],APDaft['Cumulative Return After Crash'].iloc[-1],ALBaft['Cumulative Return After Crash'].iloc[-1],AMCRaft['Cumulative Return After Crash'].iloc[-1],AVYaft['Cumulative Return After Crash'].iloc[-1],BLLaft['Cumulative Return After Crash'].iloc[-1],CEaft['Cumulative Return After Crash'].iloc[-1],CFaft['Cumulative Return After Crash'].iloc[-1],CTVAaft['Cumulative Return After Crash'].iloc[-1],DOWaft['Cumulative Return After Crash'].iloc[-1],DDaft['Cumulative Return After Crash'].iloc[-1],EMNaft['Cumulative Return After Crash'].iloc[-1],ECLaft['Cumulative Return After Crash'].iloc[-1],FMCaft['Cumulative Return After Crash'].iloc[-1],FCXaft['Cumulative Return After Crash'].iloc[-1],IPaft['Cumulative Return After Crash'].iloc[-1],IFFaft['Cumulative Return After Crash'].iloc[-1],LINaft['Cumulative Return After Crash'].iloc[-1],LYBaft['Cumulative Return After Crash'].iloc[-1],MLMaft['Cumulative Return After Crash'].iloc[-1],MOSaft['Cumulative Return After Crash'].iloc[-1],NEMaft['Cumulative Return After Crash'].iloc[-1],NUEaft['Cumulative Return After Crash'].iloc[-1],PKGaft['Cumulative Return After Crash'].iloc[-1],PPGaft['Cumulative Return After Crash'].iloc[-1],SEEaft['Cumulative Return After Crash'].iloc[-1],SHWaft['Cumulative Return After Crash'].iloc[-1],VMCaft['Cumulative Return After Crash'].iloc[-1],WRKaft['Cumulative Return After Crash'].iloc[-1]]}
matdf2 = pd.DataFrame(cumret, columns = ['Cumulative Returns 12/4-6/5', 'Cumulative Returns 12/4-2/20', 'Cumulative Returns 2/20-3/23', 'Cumulative Returns 3/23-6/5'], index= ['S&P 500','APD','ALB','AMCR','AVY','BLL','CE','CF','CTVA','DOW','DD','EMN','ECL','FMC','FCX','IP','IFF','LIN','LYB','MLM','MOS','NEM','NUE','PKG','PPG','SEE','SHW','VMC','WRK'])
pd.DataFrame(matdf2)
matdf2.sort_values('Cumulative Returns 3/23-6/5', ascending=False)
#Table of Key Statistics of Materials Stocks
import pandas as pd
import statistics as stats
matmeans = [APDmean,ALBmean,AMCRmean,AVYmean,BLLmean,CEmean,CFmean,CTVAmean,DOWmean,DDmean,EMNmean,ECLmean,FMCmean,FCXmean,IPmean,IFFmean,LINmean,LYBmean,MLMmean,MOSmean,NEMmean,NUEmean,PKGmean,PPGmean,SEEmean,SHWmean,VMCmean,WRKmean]
mataveragemean = stats.mean(matmeans)
matvariances = [APDvar,ALBvar,AMCRvar,AVYvar,BLLvar,CEvar,CFvar,CTVAvar,DOWvar,DDvar,EMNvar,ECLvar,FMCvar,FCXvar,IPvar,IFFvar,LINvar,LYBvar,MLMvar,MOSvar,NEMvar,NUEvar,PKGvar,PPGvar,SEEvar,SHWvar,VMCvar,WRKvar]
mataveragevar = stats.mean(matvariances)
matkurtoses = [APDkurt,ALBkurt,AMCRkurt,AVYkurt,BLLkurt,CEkurt,CFkurt,CTVAkurt,DOWkurt,DDkurt,EMNkurt,ECLkurt,FMCkurt,FCXkurt,IPkurt,IFFkurt,LINkurt,LYBkurt,MLMkurt,MOSkurt,NEMkurt,NUEkurt,PKGkurt,PPGkurt,SEEkurt,SHWkurt,VMCkurt,WRKkurt]
mataveragekurt = stats.mean(matkurtoses)
matskews = [APDskew,ALBskew,AMCRskew,AVYskew,BLLskew,CEskew,CFskew,CTVAskew,DOWskew,DDskew,EMNskew,ECLskew,FMCskew,FCXskew,IPskew,IFFskew,LINskew,LYBskew,MLMskew,MOSskew,NEMskew,NUEskew,PKGskew,PPGskew,SEEskew,SHWskew,VMCskew,WRKskew]
mataverageskew = stats.mean(matskews)
Materials = {'Mean': [[spmean],[mataveragemean],[APDmean], [ALBmean],[AMCRmean],[AVYmean],[BLLmean],[CEmean],[CFmean],[CTVAmean],[DOWmean],[DDmean],[EMNmean],[ECLmean],[FMCmean],[FCXmean],[IPmean],[IFFmean],[LINmean],[LYBmean],[MLMmean],[MOSmean],[NEMmean],[NUEmean],[PKGmean],[PPGmean],[SEEmean],[SHWmean],[VMCmean],[WRKmean]],
'Variance': [[spvar],[mataveragevar],[APDvar],[ALBvar],[AMCRvar],[AVYvar],[BLLvar],[CEvar],[CFvar],[CTVAvar],[DOWvar],[DDvar],[EMNvar],[ECLvar],[FMCvar],[FCXvar],[IPvar],[IFFvar],[LINvar],[LYBvar],[MLMvar],[MOSvar],[NEMvar],[NUEvar],[PKGvar],[PPGvar],[SEEvar],[SHWvar],[VMCvar],[WRKvar]],
'Kurtosis': [[spkurt],[mataveragekurt],[APDkurt],[ALBkurt],[AMCRkurt],[AVYkurt],[BLLkurt],[CEkurt],[CFkurt],[CTVAkurt],[DOWkurt],[DDkurt],[EMNkurt],[ECLkurt],[FMCkurt],[FCXkurt],[IPkurt],[IFFkurt],[LINkurt],[LYBkurt],[MLMkurt],[MOSkurt],[NEMkurt],[NUEkurt],[PKGkurt],[PPGkurt],[SEEkurt],[SHWkurt],[VMCkurt],[WRKkurt]],
'Skew': [[spskew],[mataverageskew],[APDskew],[ALBskew],[AMCRskew],[AVYskew],[BLLskew],[CEskew],[CFskew],[CTVAskew],[DOWskew],[DDskew],[EMNskew],[ECLskew],[FMCskew],[FCXskew],[IPskew],[IFFskew],[LINskew],[LYBskew],[MLMskew],[MOSskew],[NEMskew],[NUEskew],[PKGskew],[PPGskew],[SEEskew],[SHWskew],[VMCskew],[WRKskew]],
}
matdf = pd.DataFrame(Materials, columns = ['Mean', 'Variance', 'Kurtosis', 'Skew'], index= ['S&P 500','Average','APD','ALB','AMCR','AVY','BLL','CE','CF','CTVA','DOW','DD','EMN','ECL','FMC','FCX','IP','IFF','LIN','LYB','MLM','MOS','NEM','NUE','PKG','PPG','SEE','SHW','VMC','WRK']
)
pd.DataFrame(matdf)
matdf.sort_values("Mean", ascending=False)
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MMM = web.DataReader('MMM', 'yahoo', start, end)
MMM['returns'] = MMM['Close'].pct_change(1)
MMM['Cumulative Return'] = (1 + MMM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MMMmean = MMM['returns'].mean()
MMMvar = MMM['returns'].var()
MMMkurt = MMM['returns'].kurt()
MMMskew = MMM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MMMbef = web.DataReader('MMM', 'yahoo', start, crashstart)
MMMbef['avgreturnbefore'] = MMMbef['Close'].pct_change(1)
MMMbef['Cumulative Return Before Crash'] = (1 + MMMbef['avgreturnbefore']).cumprod()
#period of crash
MMMdur = web.DataReader('MMM', 'yahoo', crashstart, crashend)
MMMdur['avgreturnduring'] = MMMdur['Close'].pct_change(1)
MMMdur['Cumulative Return During Crash'] = (1 + MMMdur['avgreturnduring']).cumprod()
#period after crash
MMMaft = web.DataReader('MMM', 'yahoo', crashend, end)
MMMaft['avgreturnafter'] = MMMaft['Close'].pct_change(1)
MMMaft['Cumulative Return After Crash'] = (1 + MMMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ALK = web.DataReader('ALK', 'yahoo', start, end)
ALK['returns'] = ALK['Close'].pct_change(1)
ALK['Cumulative Return'] = (1 + ALK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ALKmean = ALK['returns'].mean()
ALKvar = ALK['returns'].var()
ALKkurt = ALK['returns'].kurt()
ALKskew = ALK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ALKbef = web.DataReader('ALK', 'yahoo', start, crashstart)
ALKbef['avgreturnbefore'] = ALKbef['Close'].pct_change(1)
ALKbef['Cumulative Return Before Crash'] = (1 + ALKbef['avgreturnbefore']).cumprod()
#period of crash
ALKdur = web.DataReader('ALK', 'yahoo', crashstart, crashend)
ALKdur['avgreturnduring'] = ALKdur['Close'].pct_change(1)
ALKdur['Cumulative Return During Crash'] = (1 + ALKdur['avgreturnduring']).cumprod()
#period after crash
ALKaft = web.DataReader('ALK', 'yahoo', crashend, end)
ALKaft['avgreturnafter'] = ALKaft['Close'].pct_change(1)
ALKaft['Cumulative Return After Crash'] = (1 + ALKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ALLE = web.DataReader('ALLE', 'yahoo', start, end)
ALLE['returns'] = ALLE['Close'].pct_change(1)
ALLE['Cumulative Return'] = (1 + ALLE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ALLEmean = ALLE['returns'].mean()
ALLEvar = ALLE['returns'].var()
ALLEkurt = ALLE['returns'].kurt()
ALLEskew = ALLE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ALLEbef = web.DataReader('ALLE', 'yahoo', start, crashstart)
ALLEbef['avgreturnbefore'] = ALLEbef['Close'].pct_change(1)
ALLEbef['Cumulative Return Before Crash'] = (1 + ALLEbef['avgreturnbefore']).cumprod()
#period of crash
ALLEdur = web.DataReader('ALLE', 'yahoo', crashstart, crashend)
ALLEdur['avgreturnduring'] = ALLEdur['Close'].pct_change(1)
ALLEdur['Cumulative Return During Crash'] = (1 + ALLEdur['avgreturnduring']).cumprod()
#period after crash
ALLEaft = web.DataReader('ALLE', 'yahoo', crashend, end)
ALLEaft['avgreturnafter'] = ALLEaft['Close'].pct_change(1)
ALLEaft['Cumulative Return After Crash'] = (1 + ALLEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AAL = web.DataReader('AAL', 'yahoo', start, end)
AAL['returns'] = AAL['Close'].pct_change(1)
AAL['Cumulative Return'] = (1 + AAL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AALmean = AAL['returns'].mean()
AALvar = AAL['returns'].var()
AALkurt = AAL['returns'].kurt()
AALskew = AAL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AALbef = web.DataReader('AAL', 'yahoo', start, crashstart)
AALbef['avgreturnbefore'] = AALbef['Close'].pct_change(1)
AALbef['Cumulative Return Before Crash'] = (1 + AALbef['avgreturnbefore']).cumprod()
#period of crash
AALdur = web.DataReader('AAL', 'yahoo', crashstart, crashend)
AALdur['avgreturnduring'] = AALdur['Close'].pct_change(1)
AALdur['Cumulative Return During Crash'] = (1 + AALdur['avgreturnduring']).cumprod()
#period after crash
AALaft = web.DataReader('AAL', 'yahoo', crashend, end)
AALaft['avgreturnafter'] = AALaft['Close'].pct_change(1)
AALaft['Cumulative Return After Crash'] = (1 + AALaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AME = web.DataReader('AME', 'yahoo', start, end)
AME['returns'] = AME['Close'].pct_change(1)
AME['Cumulative Return'] = (1 + AME['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AMEmean = AME['returns'].mean()
AMEvar = AME['returns'].var()
AMEkurt = AME['returns'].kurt()
AMEskew = AME['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AMEbef = web.DataReader('AME', 'yahoo', start, crashstart)
AMEbef['avgreturnbefore'] = AMEbef['Close'].pct_change(1)
AMEbef['Cumulative Return Before Crash'] = (1 + AMEbef['avgreturnbefore']).cumprod()
#period of crash
AMEdur = web.DataReader('AME', 'yahoo', crashstart, crashend)
AMEdur['avgreturnduring'] = AMEdur['Close'].pct_change(1)
AMEdur['Cumulative Return During Crash'] = (1 + AMEdur['avgreturnduring']).cumprod()
#period after crash
AMEaft = web.DataReader('AME', 'yahoo', crashend, end)
AMEaft['avgreturnafter'] = AMEaft['Close'].pct_change(1)
AMEaft['Cumulative Return After Crash'] = (1 + AMEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AOS = web.DataReader('AOS', 'yahoo', start, end)
AOS['returns'] = AOS['Close'].pct_change(1)
AOS['Cumulative Return'] = (1 + AOS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AOSmean = AOS['returns'].mean()
AOSvar = AOS['returns'].var()
AOSkurt = AOS['returns'].kurt()
AOSskew = AOS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AOSbef = web.DataReader('AOS', 'yahoo', start, crashstart)
AOSbef['avgreturnbefore'] = AOSbef['Close'].pct_change(1)
AOSbef['Cumulative Return Before Crash'] = (1 + AOSbef['avgreturnbefore']).cumprod()
#period of crash
AOSdur = web.DataReader('AOS', 'yahoo', crashstart, crashend)
AOSdur['avgreturnduring'] = AOSdur['Close'].pct_change(1)
AOSdur['Cumulative Return During Crash'] = (1 + AOSdur['avgreturnduring']).cumprod()
#period after crash
AOSaft = web.DataReader('AOS', 'yahoo', crashend, end)
AOSaft['avgreturnafter'] = AOSaft['Close'].pct_change(1)
AOSaft['Cumulative Return After Crash'] = (1 + AOSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BA = web.DataReader('BA', 'yahoo', start, end)
BA['returns'] = BA['Close'].pct_change(1)
BA['Cumulative Return'] = (1 + BA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BAmean = BA['returns'].mean()
BAvar = BA['returns'].var()
BAkurt = BA['returns'].kurt()
BAskew = BA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BAbef = web.DataReader('BA', 'yahoo', start, crashstart)
BAbef['avgreturnbefore'] = BAbef['Close'].pct_change(1)
BAbef['Cumulative Return Before Crash'] = (1 + BAbef['avgreturnbefore']).cumprod()
#period of crash
BAdur = web.DataReader('BA', 'yahoo', crashstart, crashend)
BAdur['avgreturnduring'] = BAdur['Close'].pct_change(1)
BAdur['Cumulative Return During Crash'] = (1 + BAdur['avgreturnduring']).cumprod()
#period after crash
BAaft = web.DataReader('BA', 'yahoo', crashend, end)
BAaft['avgreturnafter'] = BAaft['Close'].pct_change(1)
BAaft['Cumulative Return After Crash'] = (1 + BAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CHRW = web.DataReader('CHRW', 'yahoo', start, end)
CHRW['returns'] = CHRW['Close'].pct_change(1)
CHRW['Cumulative Return'] = (1 + CHRW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CHRWmean = CHRW['returns'].mean()
CHRWvar = CHRW['returns'].var()
CHRWkurt = CHRW['returns'].kurt()
CHRWskew = CHRW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CHRWbef = web.DataReader('CHRW', 'yahoo', start, crashstart)
CHRWbef['avgreturnbefore'] = CHRWbef['Close'].pct_change(1)
CHRWbef['Cumulative Return Before Crash'] = (1 + CHRWbef['avgreturnbefore']).cumprod()
#period of crash
CHRWdur = web.DataReader('CHRW', 'yahoo', crashstart, crashend)
CHRWdur['avgreturnduring'] = CHRWdur['Close'].pct_change(1)
CHRWdur['Cumulative Return During Crash'] = (1 + CHRWdur['avgreturnduring']).cumprod()
#period after crash
CHRWaft = web.DataReader('CHRW', 'yahoo', crashend, end)
CHRWaft['avgreturnafter'] = CHRWaft['Close'].pct_change(1)
CHRWaft['Cumulative Return After Crash'] = (1 + CHRWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CAT = web.DataReader('CAT', 'yahoo', start, end)
CAT['returns'] = CAT['Close'].pct_change(1)
CAT['Cumulative Return'] = (1 + CAT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CATmean = CAT['returns'].mean()
CATvar = CAT['returns'].var()
CATkurt = CAT['returns'].kurt()
CATskew = CAT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CATbef = web.DataReader('CAT', 'yahoo', start, crashstart)
CATbef['avgreturnbefore'] = CATbef['Close'].pct_change(1)
CATbef['Cumulative Return Before Crash'] = (1 + CATbef['avgreturnbefore']).cumprod()
#period of crash
CATdur = web.DataReader('CAT', 'yahoo', crashstart, crashend)
CATdur['avgreturnduring'] = CATdur['Close'].pct_change(1)
CATdur['Cumulative Return During Crash'] = (1 + CATdur['avgreturnduring']).cumprod()
#period after crash
CATaft = web.DataReader('CAT', 'yahoo', crashend, end)
CATaft['avgreturnafter'] = CATaft['Close'].pct_change(1)
CATaft['Cumulative Return After Crash'] = (1 + CATaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CTAS = web.DataReader('CTAS', 'yahoo', start, end)
CTAS['returns'] = CTAS['Close'].pct_change(1)
CTAS['Cumulative Return'] = (1 + CTAS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CTASmean = CTAS['returns'].mean()
CTASvar = CTAS['returns'].var()
CTASkurt = CTAS['returns'].kurt()
CTASskew = CTAS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CTASbef = web.DataReader('CTAS', 'yahoo', start, crashstart)
CTASbef['avgreturnbefore'] = CTASbef['Close'].pct_change(1)
CTASbef['Cumulative Return Before Crash'] = (1 + CTASbef['avgreturnbefore']).cumprod()
#period of crash
CTASdur = web.DataReader('CTAS', 'yahoo', crashstart, crashend)
CTASdur['avgreturnduring'] = CTASdur['Close'].pct_change(1)
CTASdur['Cumulative Return During Crash'] = (1 + CTASdur['avgreturnduring']).cumprod()
#period after crash
CTASaft = web.DataReader('CTAS', 'yahoo', crashend, end)
CTASaft['avgreturnafter'] = CTASaft['Close'].pct_change(1)
CTASaft['Cumulative Return After Crash'] = (1 + CTASaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CPRT = web.DataReader('CPRT', 'yahoo', start, end)
CPRT['returns'] = CPRT['Close'].pct_change(1)
CPRT['Cumulative Return'] = (1 + CPRT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CPRTmean = CPRT['returns'].mean()
CPRTvar = CPRT['returns'].var()
CPRTkurt = CPRT['returns'].kurt()
CPRTskew = CPRT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CPRTbef = web.DataReader('CPRT', 'yahoo', start, crashstart)
CPRTbef['avgreturnbefore'] = CPRTbef['Close'].pct_change(1)
CPRTbef['Cumulative Return Before Crash'] = (1 + CPRTbef['avgreturnbefore']).cumprod()
#period of crash
CPRTdur = web.DataReader('CPRT', 'yahoo', crashstart, crashend)
CPRTdur['avgreturnduring'] = CPRTdur['Close'].pct_change(1)
CPRTdur['Cumulative Return During Crash'] = (1 + CPRTdur['avgreturnduring']).cumprod()
#period after crash
CPRTaft = web.DataReader('CPRT', 'yahoo', crashend, end)
CPRTaft['avgreturnafter'] = CPRTaft['Close'].pct_change(1)
CPRTaft['Cumulative Return After Crash'] = (1 + CPRTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CSX = web.DataReader('CSX', 'yahoo', start, end)
CSX['returns'] = CSX['Close'].pct_change(1)
CSX['Cumulative Return'] = (1 + CSX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CSXmean = CSX['returns'].mean()
CSXvar = CSX['returns'].var()
CSXkurt = CSX['returns'].kurt()
CSXskew = CSX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CSXbef = web.DataReader('CSX', 'yahoo', start, crashstart)
CSXbef['avgreturnbefore'] = CSXbef['Close'].pct_change(1)
CSXbef['Cumulative Return Before Crash'] = (1 + CSXbef['avgreturnbefore']).cumprod()
#period of crash
CSXdur = web.DataReader('CSX', 'yahoo', crashstart, crashend)
CSXdur['avgreturnduring'] = CSXdur['Close'].pct_change(1)
CSXdur['Cumulative Return During Crash'] = (1 + CSXdur['avgreturnduring']).cumprod()
#period after crash
CSXaft = web.DataReader('CSX', 'yahoo', crashend, end)
CSXaft['avgreturnafter'] = CSXaft['Close'].pct_change(1)
CSXaft['Cumulative Return After Crash'] = (1 + CSXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CMI = web.DataReader('CMI', 'yahoo', start, end)
CMI['returns'] = CMI['Close'].pct_change(1)
CMI['Cumulative Return'] = (1 + CMI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CMImean = CMI['returns'].mean()
CMIvar = CMI['returns'].var()
CMIkurt = CMI['returns'].kurt()
CMIskew = CMI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CMIbef = web.DataReader('CMI', 'yahoo', start, crashstart)
CMIbef['avgreturnbefore'] = CMIbef['Close'].pct_change(1)
CMIbef['Cumulative Return Before Crash'] = (1 + CMIbef['avgreturnbefore']).cumprod()
#period of crash
CMIdur = web.DataReader('CMI', 'yahoo', crashstart, crashend)
CMIdur['avgreturnduring'] = CMIdur['Close'].pct_change(1)
CMIdur['Cumulative Return During Crash'] = (1 + CMIdur['avgreturnduring']).cumprod()
#period after crash
CMIaft = web.DataReader('CMI', 'yahoo', crashend, end)
CMIaft['avgreturnafter'] = CMIaft['Close'].pct_change(1)
CMIaft['Cumulative Return After Crash'] = (1 + CMIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DE = web.DataReader('DE', 'yahoo', start, end)
DE['returns'] = DE['Close'].pct_change(1)
DE['Cumulative Return'] = (1 + DE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DEmean = DE['returns'].mean()
DEvar = DE['returns'].var()
DEkurt = DE['returns'].kurt()
DEskew = DE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DEbef = web.DataReader('DE', 'yahoo', start, crashstart)
DEbef['avgreturnbefore'] = DEbef['Close'].pct_change(1)
DEbef['Cumulative Return Before Crash'] = (1 + DEbef['avgreturnbefore']).cumprod()
#period of crash
DEdur = web.DataReader('DE', 'yahoo', crashstart, crashend)
DEdur['avgreturnduring'] = DEdur['Close'].pct_change(1)
DEdur['Cumulative Return During Crash'] = (1 + DEdur['avgreturnduring']).cumprod()
#period after crash
DEaft = web.DataReader('DE', 'yahoo', crashend, end)
DEaft['avgreturnafter'] = DEaft['Close'].pct_change(1)
DEaft['Cumulative Return After Crash'] = (1 + DEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DAL = web.DataReader('DAL', 'yahoo', start, end)
DAL['returns'] = DAL['Close'].pct_change(1)
DAL['Cumulative Return'] = (1 + DAL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DALmean = DAL['returns'].mean()
DALvar = DAL['returns'].var()
DALkurt = DAL['returns'].kurt()
DALskew = DAL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DALbef = web.DataReader('DAL', 'yahoo', start, crashstart)
DALbef['avgreturnbefore'] = DALbef['Close'].pct_change(1)
DALbef['Cumulative Return Before Crash'] = (1 + DALbef['avgreturnbefore']).cumprod()
#period of crash
DALdur = web.DataReader('DAL', 'yahoo', crashstart, crashend)
DALdur['avgreturnduring'] = DALdur['Close'].pct_change(1)
DALdur['Cumulative Return During Crash'] = (1 + DALdur['avgreturnduring']).cumprod()
#period after crash
DALaft = web.DataReader('DAL', 'yahoo', crashend, end)
DALaft['avgreturnafter'] = DALaft['Close'].pct_change(1)
DALaft['Cumulative Return After Crash'] = (1 + DALaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DOV = web.DataReader('DOV', 'yahoo', start, end)
DOV['returns'] = DOV['Close'].pct_change(1)
DOV['Cumulative Return'] = (1 + DOV['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DOVmean = DOV['returns'].mean()
DOVvar = DOV['returns'].var()
DOVkurt = DOV['returns'].kurt()
DOVskew = DOV['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DOVbef = web.DataReader('DOV', 'yahoo', start, crashstart)
DOVbef['avgreturnbefore'] = DOVbef['Close'].pct_change(1)
DOVbef['Cumulative Return Before Crash'] = (1 + DOVbef['avgreturnbefore']).cumprod()
#period of crash
DOVdur = web.DataReader('DOV', 'yahoo', crashstart, crashend)
DOVdur['avgreturnduring'] = DOVdur['Close'].pct_change(1)
DOVdur['Cumulative Return During Crash'] = (1 + DOVdur['avgreturnduring']).cumprod()
#period after crash
DOVaft = web.DataReader('DOV', 'yahoo', crashend, end)
DOVaft['avgreturnafter'] = DOVaft['Close'].pct_change(1)
DOVaft['Cumulative Return After Crash'] = (1 + DOVaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ETN = web.DataReader('ETN', 'yahoo', start, end)
ETN['returns'] = ETN['Close'].pct_change(1)
ETN['Cumulative Return'] = (1 + ETN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ETNmean = ETN['returns'].mean()
ETNvar = ETN['returns'].var()
ETNkurt = ETN['returns'].kurt()
ETNskew = ETN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ETNbef = web.DataReader('ETN', 'yahoo', start, crashstart)
ETNbef['avgreturnbefore'] = ETNbef['Close'].pct_change(1)
ETNbef['Cumulative Return Before Crash'] = (1 + ETNbef['avgreturnbefore']).cumprod()
#period of crash
ETNdur = web.DataReader('ETN', 'yahoo', crashstart, crashend)
ETNdur['avgreturnduring'] = ETNdur['Close'].pct_change(1)
ETNdur['Cumulative Return During Crash'] = (1 + ETNdur['avgreturnduring']).cumprod()
#period after crash
ETNaft = web.DataReader('ETN', 'yahoo', crashend, end)
ETNaft['avgreturnafter'] = ETNaft['Close'].pct_change(1)
ETNaft['Cumulative Return After Crash'] = (1 + ETNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EMR = web.DataReader('EMR', 'yahoo', start, end)
EMR['returns'] = EMR['Close'].pct_change(1)
EMR['Cumulative Return'] = (1 + EMR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EMRmean = EMR['returns'].mean()
EMRvar = EMR['returns'].var()
EMRkurt = EMR['returns'].kurt()
EMRskew = EMR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EMRbef = web.DataReader('EMR', 'yahoo', start, crashstart)
EMRbef['avgreturnbefore'] = EMRbef['Close'].pct_change(1)
EMRbef['Cumulative Return Before Crash'] = (1 + EMRbef['avgreturnbefore']).cumprod()
#period of crash
EMRdur = web.DataReader('EMR', 'yahoo', crashstart, crashend)
EMRdur['avgreturnduring'] = EMRdur['Close'].pct_change(1)
EMRdur['Cumulative Return During Crash'] = (1 + EMRdur['avgreturnduring']).cumprod()
#period after crash
EMRaft = web.DataReader('EMR', 'yahoo', crashend, end)
EMRaft['avgreturnafter'] = EMRaft['Close'].pct_change(1)
EMRaft['Cumulative Return After Crash'] = (1 + EMRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EFX = web.DataReader('EFX', 'yahoo', start, end)
EFX['returns'] = EFX['Close'].pct_change(1)
EFX['Cumulative Return'] = (1 + EFX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EFXmean = EFX['returns'].mean()
EFXvar = EFX['returns'].var()
EFXkurt = EFX['returns'].kurt()
EFXskew = EFX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EFXbef = web.DataReader('EFX', 'yahoo', start, crashstart)
EFXbef['avgreturnbefore'] = EFXbef['Close'].pct_change(1)
EFXbef['Cumulative Return Before Crash'] = (1 + EFXbef['avgreturnbefore']).cumprod()
#period of crash
EFXdur = web.DataReader('EFX', 'yahoo', crashstart, crashend)
EFXdur['avgreturnduring'] = EFXdur['Close'].pct_change(1)
EFXdur['Cumulative Return During Crash'] = (1 + EFXdur['avgreturnduring']).cumprod()
#period after crash
EFXaft = web.DataReader('EFX', 'yahoo', crashend, end)
EFXaft['avgreturnafter'] = EFXaft['Close'].pct_change(1)
EFXaft['Cumulative Return After Crash'] = (1 + EFXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EXPD = web.DataReader('EXPD', 'yahoo', start, end)
EXPD['returns'] = EXPD['Close'].pct_change(1)
EXPD['Cumulative Return'] = (1 + EXPD['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EXPDmean = EXPD['returns'].mean()
EXPDvar = EXPD['returns'].var()
EXPDkurt = EXPD['returns'].kurt()
EXPDskew = EXPD['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EXPDbef = web.DataReader('EXPD', 'yahoo', start, crashstart)
EXPDbef['avgreturnbefore'] = EXPDbef['Close'].pct_change(1)
EXPDbef['Cumulative Return Before Crash'] = (1 + EXPDbef['avgreturnbefore']).cumprod()
#period of crash
EXPDdur = web.DataReader('EXPD', 'yahoo', crashstart, crashend)
EXPDdur['avgreturnduring'] = EXPDdur['Close'].pct_change(1)
EXPDdur['Cumulative Return During Crash'] = (1 + EXPDdur['avgreturnduring']).cumprod()
#period after crash
EXPDaft = web.DataReader('EXPD', 'yahoo', crashend, end)
EXPDaft['avgreturnafter'] = EXPDaft['Close'].pct_change(1)
EXPDaft['Cumulative Return After Crash'] = (1 + EXPDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FAST = web.DataReader('FAST', 'yahoo', start, end)
FAST['returns'] = FAST['Close'].pct_change(1)
FAST['Cumulative Return'] = (1 + FAST['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FASTmean = FAST['returns'].mean()
FASTvar = FAST['returns'].var()
FASTkurt = FAST['returns'].kurt()
FASTskew = FAST['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FASTbef = web.DataReader('FAST', 'yahoo', start, crashstart)
FASTbef['avgreturnbefore'] = FASTbef['Close'].pct_change(1)
FASTbef['Cumulative Return Before Crash'] = (1 + FASTbef['avgreturnbefore']).cumprod()
#period of crash
FASTdur = web.DataReader('FAST', 'yahoo', crashstart, crashend)
FASTdur['avgreturnduring'] = FASTdur['Close'].pct_change(1)
FASTdur['Cumulative Return During Crash'] = (1 + FASTdur['avgreturnduring']).cumprod()
#period after crash
FASTaft = web.DataReader('FAST', 'yahoo', crashend, end)
FASTaft['avgreturnafter'] = FASTaft['Close'].pct_change(1)
FASTaft['Cumulative Return After Crash'] = (1 + FASTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FDX = web.DataReader('FDX', 'yahoo', start, end)
FDX['returns'] = FDX['Close'].pct_change(1)
FDX['Cumulative Return'] = (1 + FDX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FDXmean = FDX['returns'].mean()
FDXvar = FDX['returns'].var()
FDXkurt = FDX['returns'].kurt()
FDXskew = FDX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FDXbef = web.DataReader('FDX', 'yahoo', start, crashstart)
FDXbef['avgreturnbefore'] = FDXbef['Close'].pct_change(1)
FDXbef['Cumulative Return Before Crash'] = (1 + FDXbef['avgreturnbefore']).cumprod()
#period of crash
FDXdur = web.DataReader('FDX', 'yahoo', crashstart, crashend)
FDXdur['avgreturnduring'] = FDXdur['Close'].pct_change(1)
FDXdur['Cumulative Return During Crash'] = (1 + FDXdur['avgreturnduring']).cumprod()
#period after crash
FDXaft = web.DataReader('FDX', 'yahoo', crashend, end)
FDXaft['avgreturnafter'] = FDXaft['Close'].pct_change(1)
FDXaft['Cumulative Return After Crash'] = (1 + FDXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FLS = web.DataReader('FLS', 'yahoo', start, end)
FLS['returns'] = FLS['Close'].pct_change(1)
FLS['Cumulative Return'] = (1 + FLS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FLSmean = FLS['returns'].mean()
FLSvar = FLS['returns'].var()
FLSkurt = FLS['returns'].kurt()
FLSskew = FLS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FLSbef = web.DataReader('FLS', 'yahoo', start, crashstart)
FLSbef['avgreturnbefore'] = FLSbef['Close'].pct_change(1)
FLSbef['Cumulative Return Before Crash'] = (1 + FLSbef['avgreturnbefore']).cumprod()
#period of crash
FLSdur = web.DataReader('FLS', 'yahoo', crashstart, crashend)
FLSdur['avgreturnduring'] = FLSdur['Close'].pct_change(1)
FLSdur['Cumulative Return During Crash'] = (1 + FLSdur['avgreturnduring']).cumprod()
#period after crash
FLSaft = web.DataReader('FLS', 'yahoo', crashend, end)
FLSaft['avgreturnafter'] = FLSaft['Close'].pct_change(1)
FLSaft['Cumulative Return After Crash'] = (1 + FLSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FTV = web.DataReader('FTV', 'yahoo', start, end)
FTV['returns'] = FTV['Close'].pct_change(1)
FTV['Cumulative Return'] = (1 + FTV['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FTVmean = FTV['returns'].mean()
FTVvar = FTV['returns'].var()
FTVkurt = FTV['returns'].kurt()
FTVskew = FTV['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FTVbef = web.DataReader('FTV', 'yahoo', start, crashstart)
FTVbef['avgreturnbefore'] = FTVbef['Close'].pct_change(1)
FTVbef['Cumulative Return Before Crash'] = (1 + FTVbef['avgreturnbefore']).cumprod()
#period of crash
FTVdur = web.DataReader('FTV', 'yahoo', crashstart, crashend)
FTVdur['avgreturnduring'] = FTVdur['Close'].pct_change(1)
FTVdur['Cumulative Return During Crash'] = (1 + FTVdur['avgreturnduring']).cumprod()
#period after crash
FTVaft = web.DataReader('FTV', 'yahoo', crashend, end)
FTVaft['avgreturnafter'] = FTVaft['Close'].pct_change(1)
FTVaft['Cumulative Return After Crash'] = (1 + FTVaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FBHS = web.DataReader('FBHS', 'yahoo', start, end)
FBHS['returns'] = FBHS['Close'].pct_change(1)
FBHS['Cumulative Return'] = (1 + FBHS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FBHSmean = FBHS['returns'].mean()
FBHSvar = FBHS['returns'].var()
FBHSkurt = FBHS['returns'].kurt()
FBHSskew = FBHS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FBHSbef = web.DataReader('FBHS', 'yahoo', start, crashstart)
FBHSbef['avgreturnbefore'] = FBHSbef['Close'].pct_change(1)
FBHSbef['Cumulative Return Before Crash'] = (1 + FBHSbef['avgreturnbefore']).cumprod()
#period of crash
FBHSdur = web.DataReader('FBHS', 'yahoo', crashstart, crashend)
FBHSdur['avgreturnduring'] = FBHSdur['Close'].pct_change(1)
FBHSdur['Cumulative Return During Crash'] = (1 + FBHSdur['avgreturnduring']).cumprod()
#period after crash
FBHSaft = web.DataReader('FBHS', 'yahoo', crashend, end)
FBHSaft['avgreturnafter'] = FBHSaft['Close'].pct_change(1)
FBHSaft['Cumulative Return After Crash'] = (1 + FBHSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GD = web.DataReader('GD', 'yahoo', start, end)
GD['returns'] = GD['Close'].pct_change(1)
GD['Cumulative Return'] = (1 + GD['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GDmean = GD['returns'].mean()
GDvar = GD['returns'].var()
GDkurt = GD['returns'].kurt()
GDskew = GD['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GDbef = web.DataReader('GD', 'yahoo', start, crashstart)
GDbef['avgreturnbefore'] = GDbef['Close'].pct_change(1)
GDbef['Cumulative Return Before Crash'] = (1 + GDbef['avgreturnbefore']).cumprod()
#period of crash
GDdur = web.DataReader('GD', 'yahoo', crashstart, crashend)
GDdur['avgreturnduring'] = GDdur['Close'].pct_change(1)
GDdur['Cumulative Return During Crash'] = (1 + GDdur['avgreturnduring']).cumprod()
#period after crash
GDaft = web.DataReader('GD', 'yahoo', crashend, end)
GDaft['avgreturnafter'] = GDaft['Close'].pct_change(1)
GDaft['Cumulative Return After Crash'] = (1 + GDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GE = web.DataReader('GE', 'yahoo', start, end)
GE['returns'] = GE['Close'].pct_change(1)
GE['Cumulative Return'] = (1 + GE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GEmean = GE['returns'].mean()
GEvar = GE['returns'].var()
GEkurt = GE['returns'].kurt()
GEskew = GE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GEbef = web.DataReader('GE', 'yahoo', start, crashstart)
GEbef['avgreturnbefore'] = GEbef['Close'].pct_change(1)
GEbef['Cumulative Return Before Crash'] = (1 + GEbef['avgreturnbefore']).cumprod()
#period of crash
GEdur = web.DataReader('GE', 'yahoo', crashstart, crashend)
GEdur['avgreturnduring'] = GEdur['Close'].pct_change(1)
GEdur['Cumulative Return During Crash'] = (1 + GEdur['avgreturnduring']).cumprod()
#period after crash
GEaft = web.DataReader('GE', 'yahoo', crashend, end)
GEaft['avgreturnafter'] = GEaft['Close'].pct_change(1)
GEaft['Cumulative Return After Crash'] = (1 + GEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GWW = web.DataReader('GWW', 'yahoo', start, end)
GWW['returns'] = GWW['Close'].pct_change(1)
GWW['Cumulative Return'] = (1 + GWW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GWWmean = GWW['returns'].mean()
GWWvar = GWW['returns'].var()
GWWkurt = GWW['returns'].kurt()
GWWskew = GWW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GWWbef = web.DataReader('GWW', 'yahoo', start, crashstart)
GWWbef['avgreturnbefore'] = GWWbef['Close'].pct_change(1)
GWWbef['Cumulative Return Before Crash'] = (1 + GWWbef['avgreturnbefore']).cumprod()
#period of crash
GWWdur = web.DataReader('GWW', 'yahoo', crashstart, crashend)
GWWdur['avgreturnduring'] = GWWdur['Close'].pct_change(1)
GWWdur['Cumulative Return During Crash'] = (1 + GWWdur['avgreturnduring']).cumprod()
#period after crash
GWWaft = web.DataReader('GWW', 'yahoo', crashend, end)
GWWaft['avgreturnafter'] = GWWaft['Close'].pct_change(1)
GWWaft['Cumulative Return After Crash'] = (1 + GWWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HON = web.DataReader('HON', 'yahoo', start, end)
HON['returns'] = HON['Close'].pct_change(1)
HON['Cumulative Return'] = (1 + HON['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HONmean = HON['returns'].mean()
HONvar = HON['returns'].var()
HONkurt = HON['returns'].kurt()
HONskew = HON['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HONbef = web.DataReader('HON', 'yahoo', start, crashstart)
HONbef['avgreturnbefore'] = HONbef['Close'].pct_change(1)
HONbef['Cumulative Return Before Crash'] = (1 + HONbef['avgreturnbefore']).cumprod()
#period of crash
HONdur = web.DataReader('HON', 'yahoo', crashstart, crashend)
HONdur['avgreturnduring'] = HONdur['Close'].pct_change(1)
HONdur['Cumulative Return During Crash'] = (1 + HONdur['avgreturnduring']).cumprod()
#period after crash
HONaft = web.DataReader('HON', 'yahoo', crashend, end)
HONaft['avgreturnafter'] = HONaft['Close'].pct_change(1)
HONaft['Cumulative Return After Crash'] = (1 + HONaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HWM = web.DataReader('HWM', 'yahoo', start, end)
HWM['returns'] = HWM['Close'].pct_change(1)
HWM['Cumulative Return'] = (1 + HWM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HWMmean = HWM['returns'].mean()
HWMvar = HWM['returns'].var()
HWMkurt = HWM['returns'].kurt()
HWMskew = HWM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HWMbef = web.DataReader('HWM', 'yahoo', start, crashstart)
HWMbef['avgreturnbefore'] = HWMbef['Close'].pct_change(1)
HWMbef['Cumulative Return Before Crash'] = (1 + HWMbef['avgreturnbefore']).cumprod()
#period of crash
HWMdur = web.DataReader('HWM', 'yahoo', crashstart, crashend)
HWMdur['avgreturnduring'] = HWMdur['Close'].pct_change(1)
HWMdur['Cumulative Return During Crash'] = (1 + HWMdur['avgreturnduring']).cumprod()
#period after crash
HWMaft = web.DataReader('HWM', 'yahoo', crashend, end)
HWMaft['avgreturnafter'] = HWMaft['Close'].pct_change(1)
HWMaft['Cumulative Return After Crash'] = (1 + HWMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HII = web.DataReader('HII', 'yahoo', start, end)
HII['returns'] = HII['Close'].pct_change(1)
HII['Cumulative Return'] = (1 + HII['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HIImean = HII['returns'].mean()
HIIvar = HII['returns'].var()
HIIkurt = HII['returns'].kurt()
HIIskew = HII['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HIIbef = web.DataReader('HII', 'yahoo', start, crashstart)
HIIbef['avgreturnbefore'] = HIIbef['Close'].pct_change(1)
HIIbef['Cumulative Return Before Crash'] = (1 + HIIbef['avgreturnbefore']).cumprod()
#period of crash
HIIdur = web.DataReader('HII', 'yahoo', crashstart, crashend)
HIIdur['avgreturnduring'] = HIIdur['Close'].pct_change(1)
HIIdur['Cumulative Return During Crash'] = (1 + HIIdur['avgreturnduring']).cumprod()
#period after crash
HIIaft = web.DataReader('HII', 'yahoo', crashend, end)
HIIaft['avgreturnafter'] = HIIaft['Close'].pct_change(1)
HIIaft['Cumulative Return After Crash'] = (1 + HIIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
IEX = web.DataReader('IEX', 'yahoo', start, end)
IEX['returns'] = IEX['Close'].pct_change(1)
IEX['Cumulative Return'] = (1 + IEX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
IEXmean = IEX['returns'].mean()
IEXvar = IEX['returns'].var()
IEXkurt = IEX['returns'].kurt()
IEXskew = IEX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
IEXbef = web.DataReader('IEX', 'yahoo', start, crashstart)
IEXbef['avgreturnbefore'] = IEXbef['Close'].pct_change(1)
IEXbef['Cumulative Return Before Crash'] = (1 + IEXbef['avgreturnbefore']).cumprod()
#period of crash
IEXdur = web.DataReader('IEX', 'yahoo', crashstart, crashend)
IEXdur['avgreturnduring'] = IEXdur['Close'].pct_change(1)
IEXdur['Cumulative Return During Crash'] = (1 + IEXdur['avgreturnduring']).cumprod()
#period after crash
IEXaft = web.DataReader('IEX', 'yahoo', crashend, end)
IEXaft['avgreturnafter'] = IEXaft['Close'].pct_change(1)
IEXaft['Cumulative Return After Crash'] = (1 + IEXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
INFO = web.DataReader('INFO', 'yahoo', start, end)
INFO['returns'] = INFO['Close'].pct_change(1)
INFO['Cumulative Return'] = (1 + INFO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
INFOmean = INFO['returns'].mean()
INFOvar = INFO['returns'].var()
INFOkurt = INFO['returns'].kurt()
INFOskew = INFO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
INFObef = web.DataReader('INFO', 'yahoo', start, crashstart)
INFObef['avgreturnbefore'] = INFObef['Close'].pct_change(1)
INFObef['Cumulative Return Before Crash'] = (1 + INFObef['avgreturnbefore']).cumprod()
#period of crash
INFOdur = web.DataReader('INFO', 'yahoo', crashstart, crashend)
INFOdur['avgreturnduring'] = INFOdur['Close'].pct_change(1)
INFOdur['Cumulative Return During Crash'] = (1 + INFOdur['avgreturnduring']).cumprod()
#period after crash
INFOaft = web.DataReader('INFO', 'yahoo', crashend, end)
INFOaft['avgreturnafter'] = INFOaft['Close'].pct_change(1)
INFOaft['Cumulative Return After Crash'] = (1 + INFOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ITW = web.DataReader('ITW', 'yahoo', start, end)
ITW['returns'] = ITW['Close'].pct_change(1)
ITW['Cumulative Return'] = (1 + ITW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ITWmean = ITW['returns'].mean()
ITWvar = ITW['returns'].var()
ITWkurt = ITW['returns'].kurt()
ITWskew = ITW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ITWbef = web.DataReader('ITW', 'yahoo', start, crashstart)
ITWbef['avgreturnbefore'] = ITWbef['Close'].pct_change(1)
ITWbef['Cumulative Return Before Crash'] = (1 + ITWbef['avgreturnbefore']).cumprod()
#period of crash
ITWdur = web.DataReader('ITW', 'yahoo', crashstart, crashend)
ITWdur['avgreturnduring'] = ITWdur['Close'].pct_change(1)
ITWdur['Cumulative Return During Crash'] = (1 + ITWdur['avgreturnduring']).cumprod()
#period after crash
ITWaft = web.DataReader('ITW', 'yahoo', crashend, end)
ITWaft['avgreturnafter'] = ITWaft['Close'].pct_change(1)
ITWaft['Cumulative Return After Crash'] = (1 + ITWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
IR = web.DataReader('IR', 'yahoo', start, end)
IR['returns'] = IR['Close'].pct_change(1)
IR['Cumulative Return'] = (1 + IR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
IRmean = IR['returns'].mean()
IRvar = IR['returns'].var()
IRkurt = IR['returns'].kurt()
IRskew = IR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
IRbef = web.DataReader('IR', 'yahoo', start, crashstart)
IRbef['avgreturnbefore'] = IRbef['Close'].pct_change(1)
IRbef['Cumulative Return Before Crash'] = (1 + IRbef['avgreturnbefore']).cumprod()
#period of crash
IRdur = web.DataReader('IR', 'yahoo', crashstart, crashend)
IRdur['avgreturnduring'] = IRdur['Close'].pct_change(1)
IRdur['Cumulative Return During Crash'] = (1 + IRdur['avgreturnduring']).cumprod()
#period after crash
IRaft = web.DataReader('IR', 'yahoo', crashend, end)
IRaft['avgreturnafter'] = IRaft['Close'].pct_change(1)
IRaft['Cumulative Return After Crash'] = (1 + IRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
J = web.DataReader('J', 'yahoo', start, end)
J['returns'] = J['Close'].pct_change(1)
J['Cumulative Return'] = (1 + J['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
Jmean = J['returns'].mean()
Jvar = J['returns'].var()
Jkurt = J['returns'].kurt()
Jskew = J['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
Jbef = web.DataReader('J', 'yahoo', start, crashstart)
Jbef['avgreturnbefore'] = Jbef['Close'].pct_change(1)
Jbef['Cumulative Return Before Crash'] = (1 + Jbef['avgreturnbefore']).cumprod()
#period of crash
Jdur = web.DataReader('J', 'yahoo', crashstart, crashend)
Jdur['avgreturnduring'] = Jdur['Close'].pct_change(1)
Jdur['Cumulative Return During Crash'] = (1 + Jdur['avgreturnduring']).cumprod()
#period after crash
Jaft = web.DataReader('J', 'yahoo', crashend, end)
Jaft['avgreturnafter'] = Jaft['Close'].pct_change(1)
Jaft['Cumulative Return After Crash'] = (1 + Jaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
JBHT = web.DataReader('JBHT', 'yahoo', start, end)
JBHT['returns'] = JBHT['Close'].pct_change(1)
JBHT['Cumulative Return'] = (1 + JBHT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
JBHTmean = JBHT['returns'].mean()
JBHTvar = JBHT['returns'].var()
JBHTkurt = JBHT['returns'].kurt()
JBHTskew = JBHT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
JBHTbef = web.DataReader('JBHT', 'yahoo', start, crashstart)
JBHTbef['avgreturnbefore'] = JBHTbef['Close'].pct_change(1)
JBHTbef['Cumulative Return Before Crash'] = (1 + JBHTbef['avgreturnbefore']).cumprod()
#period of crash
JBHTdur = web.DataReader('JBHT', 'yahoo', crashstart, crashend)
JBHTdur['avgreturnduring'] = JBHTdur['Close'].pct_change(1)
JBHTdur['Cumulative Return During Crash'] = (1 + JBHTdur['avgreturnduring']).cumprod()
#period after crash
JBHTaft = web.DataReader('JBHT', 'yahoo', crashend, end)
JBHTaft['avgreturnafter'] = JBHTaft['Close'].pct_change(1)
JBHTaft['Cumulative Return After Crash'] = (1 + JBHTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
JCI = web.DataReader('JCI', 'yahoo', start, end)
JCI['returns'] = JCI['Close'].pct_change(1)
JCI['Cumulative Return'] = (1 + JCI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
JCImean = JCI['returns'].mean()
JCIvar = JCI['returns'].var()
JCIkurt = JCI['returns'].kurt()
JCIskew = JCI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
JCIbef = web.DataReader('JCI', 'yahoo', start, crashstart)
JCIbef['avgreturnbefore'] = JCIbef['Close'].pct_change(1)
JCIbef['Cumulative Return Before Crash'] = (1 + JCIbef['avgreturnbefore']).cumprod()
#period of crash
JCIdur = web.DataReader('JCI', 'yahoo', crashstart, crashend)
JCIdur['avgreturnduring'] = JCIdur['Close'].pct_change(1)
JCIdur['Cumulative Return During Crash'] = (1 + JCIdur['avgreturnduring']).cumprod()
#period after crash
JCIaft = web.DataReader('JCI', 'yahoo', crashend, end)
JCIaft['avgreturnafter'] = JCIaft['Close'].pct_change(1)
JCIaft['Cumulative Return After Crash'] = (1 + JCIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
KSU = web.DataReader('KSU', 'yahoo', start, end)
KSU['returns'] = KSU['Close'].pct_change(1)
KSU['Cumulative Return'] = (1 + KSU['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
KSUmean = KSU['returns'].mean()
KSUvar = KSU['returns'].var()
KSUkurt = KSU['returns'].kurt()
KSUskew = KSU['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
KSUbef = web.DataReader('KSU', 'yahoo', start, crashstart)
KSUbef['avgreturnbefore'] = KSUbef['Close'].pct_change(1)
KSUbef['Cumulative Return Before Crash'] = (1 + KSUbef['avgreturnbefore']).cumprod()
#period of crash
KSUdur = web.DataReader('KSU', 'yahoo', crashstart, crashend)
KSUdur['avgreturnduring'] = KSUdur['Close'].pct_change(1)
KSUdur['Cumulative Return During Crash'] = (1 + KSUdur['avgreturnduring']).cumprod()
#period after crash
KSUaft = web.DataReader('KSU', 'yahoo', crashend, end)
KSUaft['avgreturnafter'] = KSUaft['Close'].pct_change(1)
KSUaft['Cumulative Return After Crash'] = (1 + KSUaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LHX = web.DataReader('LHX', 'yahoo', start, end)
LHX['returns'] = LHX['Close'].pct_change(1)
LHX['Cumulative Return'] = (1 + LHX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LHXmean = LHX['returns'].mean()
LHXvar = LHX['returns'].var()
LHXkurt = LHX['returns'].kurt()
LHXskew = LHX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LHXbef = web.DataReader('LHX', 'yahoo', start, crashstart)
LHXbef['avgreturnbefore'] = LHXbef['Close'].pct_change(1)
LHXbef['Cumulative Return Before Crash'] = (1 + LHXbef['avgreturnbefore']).cumprod()
#period of crash
LHXdur = web.DataReader('LHX', 'yahoo', crashstart, crashend)
LHXdur['avgreturnduring'] = LHXdur['Close'].pct_change(1)
LHXdur['Cumulative Return During Crash'] = (1 + LHXdur['avgreturnduring']).cumprod()
#period after crash
LHXaft = web.DataReader('LHX', 'yahoo', crashend, end)
LHXaft['avgreturnafter'] = LHXaft['Close'].pct_change(1)
LHXaft['Cumulative Return After Crash'] = (1 + LHXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LMT = web.DataReader('LMT', 'yahoo', start, end)
LMT['returns'] = LMT['Close'].pct_change(1)
LMT['Cumulative Return'] = (1 + LMT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LMTmean = LMT['returns'].mean()
LMTvar = LMT['returns'].var()
LMTkurt = LMT['returns'].kurt()
LMTskew = LMT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LMTbef = web.DataReader('LMT', 'yahoo', start, crashstart)
LMTbef['avgreturnbefore'] = LMTbef['Close'].pct_change(1)
LMTbef['Cumulative Return Before Crash'] = (1 + LMTbef['avgreturnbefore']).cumprod()
#period of crash
LMTdur = web.DataReader('LMT', 'yahoo', crashstart, crashend)
LMTdur['avgreturnduring'] = LMTdur['Close'].pct_change(1)
LMTdur['Cumulative Return During Crash'] = (1 + LMTdur['avgreturnduring']).cumprod()
#period after crash
LMTaft = web.DataReader('LMT', 'yahoo', crashend, end)
LMTaft['avgreturnafter'] = LMTaft['Close'].pct_change(1)
LMTaft['Cumulative Return After Crash'] = (1 + LMTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MAS = web.DataReader('MAS', 'yahoo', start, end)
MAS['returns'] = MAS['Close'].pct_change(1)
MAS['Cumulative Return'] = (1 + MAS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MASmean = MAS['returns'].mean()
MASvar = MAS['returns'].var()
MASkurt = MAS['returns'].kurt()
MASskew = MAS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MASbef = web.DataReader('MAS', 'yahoo', start, crashstart)
MASbef['avgreturnbefore'] = MASbef['Close'].pct_change(1)
MASbef['Cumulative Return Before Crash'] = (1 + MASbef['avgreturnbefore']).cumprod()
#period of crash
MASdur = web.DataReader('MAS', 'yahoo', crashstart, crashend)
MASdur['avgreturnduring'] = MASdur['Close'].pct_change(1)
MASdur['Cumulative Return During Crash'] = (1 + MASdur['avgreturnduring']).cumprod()
#period after crash
MASaft = web.DataReader('MAS', 'yahoo', crashend, end)
MASaft['avgreturnafter'] = MASaft['Close'].pct_change(1)
MASaft['Cumulative Return After Crash'] = (1 + MASaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NLSN = web.DataReader('NLSN', 'yahoo', start, end)
NLSN['returns'] = NLSN['Close'].pct_change(1)
NLSN['Cumulative Return'] = (1 + NLSN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NLSNmean = NLSN['returns'].mean()
NLSNvar = NLSN['returns'].var()
NLSNkurt = NLSN['returns'].kurt()
NLSNskew = NLSN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NLSNbef = web.DataReader('NLSN', 'yahoo', start, crashstart)
NLSNbef['avgreturnbefore'] = NLSNbef['Close'].pct_change(1)
NLSNbef['Cumulative Return Before Crash'] = (1 + NLSNbef['avgreturnbefore']).cumprod()
#period of crash
NLSNdur = web.DataReader('NLSN', 'yahoo', crashstart, crashend)
NLSNdur['avgreturnduring'] = NLSNdur['Close'].pct_change(1)
NLSNdur['Cumulative Return During Crash'] = (1 + NLSNdur['avgreturnduring']).cumprod()
#period after crash
NLSNaft = web.DataReader('NLSN', 'yahoo', crashend, end)
NLSNaft['avgreturnafter'] = NLSNaft['Close'].pct_change(1)
NLSNaft['Cumulative Return After Crash'] = (1 + NLSNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NSC = web.DataReader('NSC', 'yahoo', start, end)
NSC['returns'] = NSC['Close'].pct_change(1)
NSC['Cumulative Return'] = (1 + NSC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NSCmean = NSC['returns'].mean()
NSCvar = NSC['returns'].var()
NSCkurt = NSC['returns'].kurt()
NSCskew = NSC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NSCbef = web.DataReader('NSC', 'yahoo', start, crashstart)
NSCbef['avgreturnbefore'] = NSCbef['Close'].pct_change(1)
NSCbef['Cumulative Return Before Crash'] = (1 + NSCbef['avgreturnbefore']).cumprod()
#period of crash
NSCdur = web.DataReader('NSC', 'yahoo', crashstart, crashend)
NSCdur['avgreturnduring'] = NSCdur['Close'].pct_change(1)
NSCdur['Cumulative Return During Crash'] = (1 + NSCdur['avgreturnduring']).cumprod()
#period after crash
NSCaft = web.DataReader('NSC', 'yahoo', crashend, end)
NSCaft['avgreturnafter'] = NSCaft['Close'].pct_change(1)
NSCaft['Cumulative Return After Crash'] = (1 + NSCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NOC = web.DataReader('NOC', 'yahoo', start, end)
NOC['returns'] = NOC['Close'].pct_change(1)
NOC['Cumulative Return'] = (1 + NOC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NOCmean = NOC['returns'].mean()
NOCvar = NOC['returns'].var()
NOCkurt = NOC['returns'].kurt()
NOCskew = NOC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NOCbef = web.DataReader('NOC', 'yahoo', start, crashstart)
NOCbef['avgreturnbefore'] = NOCbef['Close'].pct_change(1)
NOCbef['Cumulative Return Before Crash'] = (1 + NOCbef['avgreturnbefore']).cumprod()
#period of crash
NOCdur = web.DataReader('NOC', 'yahoo', crashstart, crashend)
NOCdur['avgreturnduring'] = NOCdur['Close'].pct_change(1)
NOCdur['Cumulative Return During Crash'] = (1 + NOCdur['avgreturnduring']).cumprod()
#period after crash
NOCaft = web.DataReader('NOC', 'yahoo', crashend, end)
NOCaft['avgreturnafter'] = NOCaft['Close'].pct_change(1)
NOCaft['Cumulative Return After Crash'] = (1 + NOCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ODFL = web.DataReader('ODFL', 'yahoo', start, end)
ODFL['returns'] = ODFL['Close'].pct_change(1)
ODFL['Cumulative Return'] = (1 + ODFL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ODFLmean = ODFL['returns'].mean()
ODFLvar = ODFL['returns'].var()
ODFLkurt = ODFL['returns'].kurt()
ODFLskew = ODFL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ODFLbef = web.DataReader('ODFL', 'yahoo', start, crashstart)
ODFLbef['avgreturnbefore'] = ODFLbef['Close'].pct_change(1)
ODFLbef['Cumulative Return Before Crash'] = (1 + ODFLbef['avgreturnbefore']).cumprod()
#period of crash
ODFLdur = web.DataReader('ODFL', 'yahoo', crashstart, crashend)
ODFLdur['avgreturnduring'] = ODFLdur['Close'].pct_change(1)
ODFLdur['Cumulative Return During Crash'] = (1 + ODFLdur['avgreturnduring']).cumprod()
#period after crash
ODFLaft = web.DataReader('ODFL', 'yahoo', crashend, end)
ODFLaft['avgreturnafter'] = ODFLaft['Close'].pct_change(1)
ODFLaft['Cumulative Return After Crash'] = (1 + ODFLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PCAR = web.DataReader('PCAR', 'yahoo', start, end)
PCAR['returns'] = PCAR['Close'].pct_change(1)
PCAR['Cumulative Return'] = (1 + PCAR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PCARmean = PCAR['returns'].mean()
PCARvar = PCAR['returns'].var()
PCARkurt = PCAR['returns'].kurt()
PCARskew = PCAR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PCARbef = web.DataReader('PCAR', 'yahoo', start, crashstart)
PCARbef['avgreturnbefore'] = PCARbef['Close'].pct_change(1)
PCARbef['Cumulative Return Before Crash'] = (1 + PCARbef['avgreturnbefore']).cumprod()
#period of crash
PCARdur = web.DataReader('PCAR', 'yahoo', crashstart, crashend)
PCARdur['avgreturnduring'] = PCARdur['Close'].pct_change(1)
PCARdur['Cumulative Return During Crash'] = (1 + PCARdur['avgreturnduring']).cumprod()
#period after crash
PCARaft = web.DataReader('PCAR', 'yahoo', crashend, end)
PCARaft['avgreturnafter'] = PCARaft['Close'].pct_change(1)
PCARaft['Cumulative Return After Crash'] = (1 + PCARaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PH = web.DataReader('PH', 'yahoo', start, end)
PH['returns'] = PH['Close'].pct_change(1)
PH['Cumulative Return'] = (1 + PH['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PHmean = PH['returns'].mean()
PHvar = PH['returns'].var()
PHkurt = PH['returns'].kurt()
PHskew = PH['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PHbef = web.DataReader('PH', 'yahoo', start, crashstart)
PHbef['avgreturnbefore'] = PHbef['Close'].pct_change(1)
PHbef['Cumulative Return Before Crash'] = (1 + PHbef['avgreturnbefore']).cumprod()
#period of crash
PHdur = web.DataReader('PH', 'yahoo', crashstart, crashend)
PHdur['avgreturnduring'] = PHdur['Close'].pct_change(1)
PHdur['Cumulative Return During Crash'] = (1 + PHdur['avgreturnduring']).cumprod()
#period after crash
PHaft = web.DataReader('PH', 'yahoo', crashend, end)
PHaft['avgreturnafter'] = PHaft['Close'].pct_change(1)
PHaft['Cumulative Return After Crash'] = (1 + PHaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PNR = web.DataReader('PNR', 'yahoo', start, end)
PNR['returns'] = PNR['Close'].pct_change(1)
PNR['Cumulative Return'] = (1 + PNR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PNRmean = PNR['returns'].mean()
PNRvar = PNR['returns'].var()
PNRkurt = PNR['returns'].kurt()
PNRskew = PNR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PNRbef = web.DataReader('PNR', 'yahoo', start, crashstart)
PNRbef['avgreturnbefore'] = PNRbef['Close'].pct_change(1)
PNRbef['Cumulative Return Before Crash'] = (1 + PNRbef['avgreturnbefore']).cumprod()
#period of crash
PNRdur = web.DataReader('PNR', 'yahoo', crashstart, crashend)
PNRdur['avgreturnduring'] = PNRdur['Close'].pct_change(1)
PNRdur['Cumulative Return During Crash'] = (1 + PNRdur['avgreturnduring']).cumprod()
#period after crash
PNRaft = web.DataReader('PNR', 'yahoo', crashend, end)
PNRaft['avgreturnafter'] = PNRaft['Close'].pct_change(1)
PNRaft['Cumulative Return After Crash'] = (1 + PNRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PWR = web.DataReader('PWR', 'yahoo', start, end)
PWR['returns'] = PWR['Close'].pct_change(1)
PWR['Cumulative Return'] = (1 + PWR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PWRmean = PWR['returns'].mean()
PWRvar = PWR['returns'].var()
PWRkurt = PWR['returns'].kurt()
PWRskew = PWR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PWRbef = web.DataReader('PWR', 'yahoo', start, crashstart)
PWRbef['avgreturnbefore'] = PWRbef['Close'].pct_change(1)
PWRbef['Cumulative Return Before Crash'] = (1 + PWRbef['avgreturnbefore']).cumprod()
#period of crash
PWRdur = web.DataReader('PWR', 'yahoo', crashstart, crashend)
PWRdur['avgreturnduring'] = PWRdur['Close'].pct_change(1)
PWRdur['Cumulative Return During Crash'] = (1 + PWRdur['avgreturnduring']).cumprod()
#period after crash
PWRaft = web.DataReader('PWR', 'yahoo', crashend, end)
PWRaft['avgreturnafter'] = PWRaft['Close'].pct_change(1)
PWRaft['Cumulative Return After Crash'] = (1 + PWRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
RTX = web.DataReader('RTX', 'yahoo', start, end)
RTX['returns'] = RTX['Close'].pct_change(1)
RTX['Cumulative Return'] = (1 + RTX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
RTXmean = RTX['returns'].mean()
RTXvar = RTX['returns'].var()
RTXkurt = RTX['returns'].kurt()
RTXskew = RTX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
RTXbef = web.DataReader('RTX', 'yahoo', start, crashstart)
RTXbef['avgreturnbefore'] = RTXbef['Close'].pct_change(1)
RTXbef['Cumulative Return Before Crash'] = (1 + RTXbef['avgreturnbefore']).cumprod()
#period of crash
RTXdur = web.DataReader('RTX', 'yahoo', crashstart, crashend)
RTXdur['avgreturnduring'] = RTXdur['Close'].pct_change(1)
RTXdur['Cumulative Return During Crash'] = (1 + RTXdur['avgreturnduring']).cumprod()
#period after crash
RTXaft = web.DataReader('RTX', 'yahoo', crashend, end)
RTXaft['avgreturnafter'] = RTXaft['Close'].pct_change(1)
RTXaft['Cumulative Return After Crash'] = (1 + RTXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
RSG = web.DataReader('RSG', 'yahoo', start, end)
RSG['returns'] = RSG['Close'].pct_change(1)
RSG['Cumulative Return'] = (1 + RSG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
RSGmean = RSG['returns'].mean()
RSGvar = RSG['returns'].var()
RSGkurt = RSG['returns'].kurt()
RSGskew = RSG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
RSGbef = web.DataReader('RSG', 'yahoo', start, crashstart)
RSGbef['avgreturnbefore'] = RSGbef['Close'].pct_change(1)
RSGbef['Cumulative Return Before Crash'] = (1 + RSGbef['avgreturnbefore']).cumprod()
#period of crash
RSGdur = web.DataReader('RSG', 'yahoo', crashstart, crashend)
RSGdur['avgreturnduring'] = RSGdur['Close'].pct_change(1)
RSGdur['Cumulative Return During Crash'] = (1 + RSGdur['avgreturnduring']).cumprod()
#period after crash
RSGaft = web.DataReader('RSG', 'yahoo', crashend, end)
RSGaft['avgreturnafter'] = RSGaft['Close'].pct_change(1)
RSGaft['Cumulative Return After Crash'] = (1 + RSGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
RHI = web.DataReader('RHI', 'yahoo', start, end)
RHI['returns'] = RHI['Close'].pct_change(1)
RHI['Cumulative Return'] = (1 + RHI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
RHImean = RHI['returns'].mean()
RHIvar = RHI['returns'].var()
RHIkurt = RHI['returns'].kurt()
RHIskew = RHI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
RHIbef = web.DataReader('RHI', 'yahoo', start, crashstart)
RHIbef['avgreturnbefore'] = RHIbef['Close'].pct_change(1)
RHIbef['Cumulative Return Before Crash'] = (1 + RHIbef['avgreturnbefore']).cumprod()
#period of crash
RHIdur = web.DataReader('RHI', 'yahoo', crashstart, crashend)
RHIdur['avgreturnduring'] = RHIdur['Close'].pct_change(1)
RHIdur['Cumulative Return During Crash'] = (1 + RHIdur['avgreturnduring']).cumprod()
#period after crash
RHIaft = web.DataReader('RHI', 'yahoo', crashend, end)
RHIaft['avgreturnafter'] = RHIaft['Close'].pct_change(1)
RHIaft['Cumulative Return After Crash'] = (1 + RHIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ROK = web.DataReader('ROK', 'yahoo', start, end)
ROK['returns'] = ROK['Close'].pct_change(1)
ROK['Cumulative Return'] = (1 + ROK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ROKmean = ROK['returns'].mean()
ROKvar = ROK['returns'].var()
ROKkurt = ROK['returns'].kurt()
ROKskew = ROK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ROKbef = web.DataReader('ROK', 'yahoo', start, crashstart)
ROKbef['avgreturnbefore'] = ROKbef['Close'].pct_change(1)
ROKbef['Cumulative Return Before Crash'] = (1 + ROKbef['avgreturnbefore']).cumprod()
#period of crash
ROKdur = web.DataReader('ROK', 'yahoo', crashstart, crashend)
ROKdur['avgreturnduring'] = ROKdur['Close'].pct_change(1)
ROKdur['Cumulative Return During Crash'] = (1 + ROKdur['avgreturnduring']).cumprod()
#period after crash
ROKaft = web.DataReader('ROK', 'yahoo', crashend, end)
ROKaft['avgreturnafter'] = ROKaft['Close'].pct_change(1)
ROKaft['Cumulative Return After Crash'] = (1 + ROKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ROL = web.DataReader('ROL', 'yahoo', start, end)
ROL['returns'] = ROL['Close'].pct_change(1)
ROL['Cumulative Return'] = (1 + ROL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ROLmean = ROL['returns'].mean()
ROLvar = ROL['returns'].var()
ROLkurt = ROL['returns'].kurt()
ROLskew = ROL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ROLbef = web.DataReader('ROL', 'yahoo', start, crashstart)
ROLbef['avgreturnbefore'] = ROLbef['Close'].pct_change(1)
ROLbef['Cumulative Return Before Crash'] = (1 + ROLbef['avgreturnbefore']).cumprod()
#period of crash
ROLdur = web.DataReader('ROL', 'yahoo', crashstart, crashend)
ROLdur['avgreturnduring'] = ROLdur['Close'].pct_change(1)
ROLdur['Cumulative Return During Crash'] = (1 + ROLdur['avgreturnduring']).cumprod()
#period after crash
ROLaft = web.DataReader('ROL', 'yahoo', crashend, end)
ROLaft['avgreturnafter'] = ROLaft['Close'].pct_change(1)
ROLaft['Cumulative Return After Crash'] = (1 + ROLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ROP = web.DataReader('ROP', 'yahoo', start, end)
ROP['returns'] = ROP['Close'].pct_change(1)
ROP['Cumulative Return'] = (1 + ROP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ROPmean = ROP['returns'].mean()
ROPvar = ROP['returns'].var()
ROPkurt = ROP['returns'].kurt()
ROPskew = ROP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ROPbef = web.DataReader('ROP', 'yahoo', start, crashstart)
ROPbef['avgreturnbefore'] = ROPbef['Close'].pct_change(1)
ROPbef['Cumulative Return Before Crash'] = (1 + ROPbef['avgreturnbefore']).cumprod()
#period of crash
ROPdur = web.DataReader('ROP', 'yahoo', crashstart, crashend)
ROPdur['avgreturnduring'] = ROPdur['Close'].pct_change(1)
ROPdur['Cumulative Return During Crash'] = (1 + ROPdur['avgreturnduring']).cumprod()
#period after crash
ROPaft = web.DataReader('ROP', 'yahoo', crashend, end)
ROPaft['avgreturnafter'] = ROPaft['Close'].pct_change(1)
ROPaft['Cumulative Return After Crash'] = (1 + ROPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SNA = web.DataReader('SNA', 'yahoo', start, end)
SNA['returns'] = SNA['Close'].pct_change(1)
SNA['Cumulative Return'] = (1 + SNA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SNAmean = SNA['returns'].mean()
SNAvar = SNA['returns'].var()
SNAkurt = SNA['returns'].kurt()
SNAskew = SNA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SNAbef = web.DataReader('SNA', 'yahoo', start, crashstart)
SNAbef['avgreturnbefore'] = SNAbef['Close'].pct_change(1)
SNAbef['Cumulative Return Before Crash'] = (1 + SNAbef['avgreturnbefore']).cumprod()
#period of crash
SNAdur = web.DataReader('SNA', 'yahoo', crashstart, crashend)
SNAdur['avgreturnduring'] = SNAdur['Close'].pct_change(1)
SNAdur['Cumulative Return During Crash'] = (1 + SNAdur['avgreturnduring']).cumprod()
#period after crash
SNAaft = web.DataReader('SNA', 'yahoo', crashend, end)
SNAaft['avgreturnafter'] = SNAaft['Close'].pct_change(1)
SNAaft['Cumulative Return After Crash'] = (1 + SNAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LUV = web.DataReader('LUV', 'yahoo', start, end)
LUV['returns'] = LUV['Close'].pct_change(1)
LUV['Cumulative Return'] = (1 + LUV['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LUVmean = LUV['returns'].mean()
LUVvar = LUV['returns'].var()
LUVkurt = LUV['returns'].kurt()
LUVskew = LUV['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LUVbef = web.DataReader('LUV', 'yahoo', start, crashstart)
LUVbef['avgreturnbefore'] = LUVbef['Close'].pct_change(1)
LUVbef['Cumulative Return Before Crash'] = (1 + LUVbef['avgreturnbefore']).cumprod()
#period of crash
LUVdur = web.DataReader('LUV', 'yahoo', crashstart, crashend)
LUVdur['avgreturnduring'] = LUVdur['Close'].pct_change(1)
LUVdur['Cumulative Return During Crash'] = (1 + LUVdur['avgreturnduring']).cumprod()
#period after crash
LUVaft = web.DataReader('LUV', 'yahoo', crashend, end)
LUVaft['avgreturnafter'] = LUVaft['Close'].pct_change(1)
LUVaft['Cumulative Return After Crash'] = (1 + LUVaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SWK = web.DataReader('SWK', 'yahoo', start, end)
SWK['returns'] = SWK['Close'].pct_change(1)
SWK['Cumulative Return'] = (1 + SWK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SWKmean = SWK['returns'].mean()
SWKvar = SWK['returns'].var()
SWKkurt = SWK['returns'].kurt()
SWKskew = SWK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SWKbef = web.DataReader('SWK', 'yahoo', start, crashstart)
SWKbef['avgreturnbefore'] = SWKbef['Close'].pct_change(1)
SWKbef['Cumulative Return Before Crash'] = (1 + SWKbef['avgreturnbefore']).cumprod()
#period of crash
SWKdur = web.DataReader('SWK', 'yahoo', crashstart, crashend)
SWKdur['avgreturnduring'] = SWKdur['Close'].pct_change(1)
SWKdur['Cumulative Return During Crash'] = (1 + SWKdur['avgreturnduring']).cumprod()
#period after crash
SWKaft = web.DataReader('SWK', 'yahoo', crashend, end)
SWKaft['avgreturnafter'] = SWKaft['Close'].pct_change(1)
SWKaft['Cumulative Return After Crash'] = (1 + SWKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TXT = web.DataReader('TXT', 'yahoo', start, end)
TXT['returns'] = TXT['Close'].pct_change(1)
TXT['Cumulative Return'] = (1 + TXT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TXTmean = TXT['returns'].mean()
TXTvar = TXT['returns'].var()
TXTkurt = TXT['returns'].kurt()
TXTskew = TXT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TXTbef = web.DataReader('TXT', 'yahoo', start, crashstart)
TXTbef['avgreturnbefore'] = TXTbef['Close'].pct_change(1)
TXTbef['Cumulative Return Before Crash'] = (1 + TXTbef['avgreturnbefore']).cumprod()
#period of crash
TXTdur = web.DataReader('TXT', 'yahoo', crashstart, crashend)
TXTdur['avgreturnduring'] = TXTdur['Close'].pct_change(1)
TXTdur['Cumulative Return During Crash'] = (1 + TXTdur['avgreturnduring']).cumprod()
#period after crash
TXTaft = web.DataReader('TXT', 'yahoo', crashend, end)
TXTaft['avgreturnafter'] = TXTaft['Close'].pct_change(1)
TXTaft['Cumulative Return After Crash'] = (1 + TXTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TT = web.DataReader('TT', 'yahoo', start, end)
TT['returns'] = TT['Close'].pct_change(1)
TT['Cumulative Return'] = (1 + TT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TTmean = TT['returns'].mean()
TTvar = TT['returns'].var()
TTkurt = TT['returns'].kurt()
TTskew = TT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TTbef = web.DataReader('TT', 'yahoo', start, crashstart)
TTbef['avgreturnbefore'] = TTbef['Close'].pct_change(1)
TTbef['Cumulative Return Before Crash'] = (1 + TTbef['avgreturnbefore']).cumprod()
#period of crash
TTdur = web.DataReader('TT', 'yahoo', crashstart, crashend)
TTdur['avgreturnduring'] = TTdur['Close'].pct_change(1)
TTdur['Cumulative Return During Crash'] = (1 + TTdur['avgreturnduring']).cumprod()
#period after crash
TTaft = web.DataReader('TT', 'yahoo', crashend, end)
TTaft['avgreturnafter'] = TTaft['Close'].pct_change(1)
TTaft['Cumulative Return After Crash'] = (1 + TTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TDG = web.DataReader('TDG', 'yahoo', start, end)
TDG['returns'] = TDG['Close'].pct_change(1)
TDG['Cumulative Return'] = (1 + TDG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TDGmean = TDG['returns'].mean()
TDGvar = TDG['returns'].var()
TDGkurt = TDG['returns'].kurt()
TDGskew = TDG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TDGbef = web.DataReader('TDG', 'yahoo', start, crashstart)
TDGbef['avgreturnbefore'] = TDGbef['Close'].pct_change(1)
TDGbef['Cumulative Return Before Crash'] = (1 + TDGbef['avgreturnbefore']).cumprod()
#period of crash
TDGdur = web.DataReader('TDG', 'yahoo', crashstart, crashend)
TDGdur['avgreturnduring'] = TDGdur['Close'].pct_change(1)
TDGdur['Cumulative Return During Crash'] = (1 + TDGdur['avgreturnduring']).cumprod()
#period after crash
TDGaft = web.DataReader('TDG', 'yahoo', crashend, end)
TDGaft['avgreturnafter'] = TDGaft['Close'].pct_change(1)
TDGaft['Cumulative Return After Crash'] = (1 + TDGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
UNP = web.DataReader('UNP', 'yahoo', start, end)
UNP['returns'] = UNP['Close'].pct_change(1)
UNP['Cumulative Return'] = (1 + UNP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
UNPmean = UNP['returns'].mean()
UNPvar = UNP['returns'].var()
UNPkurt = UNP['returns'].kurt()
UNPskew = UNP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
UNPbef = web.DataReader('UNP', 'yahoo', start, crashstart)
UNPbef['avgreturnbefore'] = UNPbef['Close'].pct_change(1)
UNPbef['Cumulative Return Before Crash'] = (1 + UNPbef['avgreturnbefore']).cumprod()
#period of crash
UNPdur = web.DataReader('UNP', 'yahoo', crashstart, crashend)
UNPdur['avgreturnduring'] = UNPdur['Close'].pct_change(1)
UNPdur['Cumulative Return During Crash'] = (1 + UNPdur['avgreturnduring']).cumprod()
#period after crash
UNPaft = web.DataReader('UNP', 'yahoo', crashend, end)
UNPaft['avgreturnafter'] = UNPaft['Close'].pct_change(1)
UNPaft['Cumulative Return After Crash'] = (1 + UNPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
UAL = web.DataReader('UAL', 'yahoo', start, end)
UAL['returns'] = UAL['Close'].pct_change(1)
UAL['Cumulative Return'] = (1 + UAL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
UALmean = UAL['returns'].mean()
UALvar = UAL['returns'].var()
UALkurt = UAL['returns'].kurt()
UALskew = UAL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
UALbef = web.DataReader('UAL', 'yahoo', start, crashstart)
UALbef['avgreturnbefore'] = UALbef['Close'].pct_change(1)
UALbef['Cumulative Return Before Crash'] = (1 + UALbef['avgreturnbefore']).cumprod()
#period of crash
UALdur = web.DataReader('UAL', 'yahoo', crashstart, crashend)
UALdur['avgreturnduring'] = UALdur['Close'].pct_change(1)
UALdur['Cumulative Return During Crash'] = (1 + UALdur['avgreturnduring']).cumprod()
#period after crash
UALaft = web.DataReader('UAL', 'yahoo', crashend, end)
UALaft['avgreturnafter'] = UALaft['Close'].pct_change(1)
UALaft['Cumulative Return After Crash'] = (1 + UALaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
UPS = web.DataReader('UPS', 'yahoo', start, end)
UPS['returns'] = UPS['Close'].pct_change(1)
UPS['Cumulative Return'] = (1 + UPS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
UPSmean = UPS['returns'].mean()
UPSvar = UPS['returns'].var()
UPSkurt = UPS['returns'].kurt()
UPSskew = UPS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
UPSbef = web.DataReader('UPS', 'yahoo', start, crashstart)
UPSbef['avgreturnbefore'] = UPSbef['Close'].pct_change(1)
UPSbef['Cumulative Return Before Crash'] = (1 + UPSbef['avgreturnbefore']).cumprod()
#period of crash
UPSdur = web.DataReader('UPS', 'yahoo', crashstart, crashend)
UPSdur['avgreturnduring'] = UPSdur['Close'].pct_change(1)
UPSdur['Cumulative Return During Crash'] = (1 + UPSdur['avgreturnduring']).cumprod()
#period after crash
UPSaft = web.DataReader('UPS', 'yahoo', crashend, end)
UPSaft['avgreturnafter'] = UPSaft['Close'].pct_change(1)
UPSaft['Cumulative Return After Crash'] = (1 + UPSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
URI = web.DataReader('URI', 'yahoo', start, end)
URI['returns'] = URI['Close'].pct_change(1)
URI['Cumulative Return'] = (1 + URI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
URImean = URI['returns'].mean()
URIvar = URI['returns'].var()
URIkurt = URI['returns'].kurt()
URIskew = URI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
URIbef = web.DataReader('URI', 'yahoo', start, crashstart)
URIbef['avgreturnbefore'] = URIbef['Close'].pct_change(1)
URIbef['Cumulative Return Before Crash'] = (1 + URIbef['avgreturnbefore']).cumprod()
#period of crash
URIdur = web.DataReader('URI', 'yahoo', crashstart, crashend)
URIdur['avgreturnduring'] = URIdur['Close'].pct_change(1)
URIdur['Cumulative Return During Crash'] = (1 + URIdur['avgreturnduring']).cumprod()
#period after crash
URIaft = web.DataReader('URI', 'yahoo', crashend, end)
URIaft['avgreturnafter'] = URIaft['Close'].pct_change(1)
URIaft['Cumulative Return After Crash'] = (1 + URIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
VRSK = web.DataReader('VRSK', 'yahoo', start, end)
VRSK['returns'] = VRSK['Close'].pct_change(1)
VRSK['Cumulative Return'] = (1 + VRSK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
VRSKmean = VRSK['returns'].mean()
VRSKvar = VRSK['returns'].var()
VRSKkurt = VRSK['returns'].kurt()
VRSKskew = VRSK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
VRSKbef = web.DataReader('VRSK', 'yahoo', start, crashstart)
VRSKbef['avgreturnbefore'] = VRSKbef['Close'].pct_change(1)
VRSKbef['Cumulative Return Before Crash'] = (1 + VRSKbef['avgreturnbefore']).cumprod()
#period of crash
VRSKdur = web.DataReader('VRSK', 'yahoo', crashstart, crashend)
VRSKdur['avgreturnduring'] = VRSKdur['Close'].pct_change(1)
VRSKdur['Cumulative Return During Crash'] = (1 + VRSKdur['avgreturnduring']).cumprod()
#period after crash
VRSKaft = web.DataReader('VRSK', 'yahoo', crashend, end)
VRSKaft['avgreturnafter'] = VRSKaft['Close'].pct_change(1)
VRSKaft['Cumulative Return After Crash'] = (1 + VRSKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WAB = web.DataReader('WAB', 'yahoo', start, end)
WAB['returns'] = WAB['Close'].pct_change(1)
WAB['Cumulative Return'] = (1 + WAB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WABmean = WAB['returns'].mean()
WABvar = WAB['returns'].var()
WABkurt = WAB['returns'].kurt()
WABskew = WAB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WABbef = web.DataReader('WAB', 'yahoo', start, crashstart)
WABbef['avgreturnbefore'] = WABbef['Close'].pct_change(1)
WABbef['Cumulative Return Before Crash'] = (1 + WABbef['avgreturnbefore']).cumprod()
#period of crash
WABdur = web.DataReader('WAB', 'yahoo', crashstart, crashend)
WABdur['avgreturnduring'] = WABdur['Close'].pct_change(1)
WABdur['Cumulative Return During Crash'] = (1 + WABdur['avgreturnduring']).cumprod()
#period after crash
WABaft = web.DataReader('WAB', 'yahoo', crashend, end)
WABaft['avgreturnafter'] = WABaft['Close'].pct_change(1)
WABaft['Cumulative Return After Crash'] = (1 + WABaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WM = web.DataReader('WM', 'yahoo', start, end)
WM['returns'] = WM['Close'].pct_change(1)
WM['Cumulative Return'] = (1 + WM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WMmean = WM['returns'].mean()
WMvar = WM['returns'].var()
WMkurt = WM['returns'].kurt()
WMskew = WM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WMbef = web.DataReader('WM', 'yahoo', start, crashstart)
WMbef['avgreturnbefore'] = WMbef['Close'].pct_change(1)
WMbef['Cumulative Return Before Crash'] = (1 + WMbef['avgreturnbefore']).cumprod()
#period of crash
WMdur = web.DataReader('WM', 'yahoo', crashstart, crashend)
WMdur['avgreturnduring'] = WMdur['Close'].pct_change(1)
WMdur['Cumulative Return During Crash'] = (1 + WMdur['avgreturnduring']).cumprod()
#period after crash
WMaft = web.DataReader('WM', 'yahoo', crashend, end)
WMaft['avgreturnafter'] = WMaft['Close'].pct_change(1)
WMaft['Cumulative Return After Crash'] = (1 + WMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
XYL = web.DataReader('XYL', 'yahoo', start, end)
XYL['returns'] = XYL['Close'].pct_change(1)
XYL['Cumulative Return'] = (1 + XYL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
XYLmean = XYL['returns'].mean()
XYLvar = XYL['returns'].var()
XYLkurt = XYL['returns'].kurt()
XYLskew = XYL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
XYLbef = web.DataReader('XYL', 'yahoo', start, crashstart)
XYLbef['avgreturnbefore'] = XYLbef['Close'].pct_change(1)
XYLbef['Cumulative Return Before Crash'] = (1 + XYLbef['avgreturnbefore']).cumprod()
#period of crash
XYLdur = web.DataReader('XYL', 'yahoo', crashstart, crashend)
XYLdur['avgreturnduring'] = XYLdur['Close'].pct_change(1)
XYLdur['Cumulative Return During Crash'] = (1 + XYLdur['avgreturnduring']).cumprod()
#period after crash
XYLaft = web.DataReader('XYL', 'yahoo', crashend, end)
XYLaft['avgreturnafter'] = XYLaft['Close'].pct_change(1)
XYLaft['Cumulative Return After Crash'] = (1 + XYLaft['avgreturnafter']).cumprod()
#KDE Plot for Industrials Sector
sp['returns'].plot(kind = 'kde', label ='S&P 500', alpha=0.5)
MMM['returns'].plot(kind = 'kde', label ='MMM', figsize = (10,8), alpha=0.5, title = 'KDE of Industrials Stocks')
ALK['returns'].plot(kind = 'kde', label ='ALK', alpha=0.5)
ALLE['returns'].plot(kind = 'kde', label ='ALLE', alpha=0.5)
AAL['returns'].plot(kind = 'kde', label ='AAL', alpha=0.5)
AME['returns'].plot(kind = 'kde', label ='AME', alpha=0.5)
AOS['returns'].plot(kind = 'kde', label ='AOS', alpha=0.5)
BA['returns'].plot(kind = 'kde', label ='BA', alpha=0.5)
CHRW['returns'].plot(kind = 'kde', label ='CHRW', alpha=0.5)
CAT['returns'].plot(kind = 'kde', label ='CAT', alpha=0.5)
CTAS['returns'].plot(kind = 'kde', label ='CTAS', alpha=0.5)
CPRT['returns'].plot(kind = 'kde', label ='CPRT', alpha=0.5)
CSX['returns'].plot(kind = 'kde', label ='CSX', alpha=0.5)
CMI['returns'].plot(kind = 'kde', label ='CMI', alpha=0.5)
DE['returns'].plot(kind = 'kde', label ='DE', alpha=0.5)
DAL['returns'].plot(kind = 'kde', label ='DAL', alpha=0.5)
DOV['returns'].plot(kind = 'kde', label ='DOV', alpha=0.5)
ETN['returns'].plot(kind = 'kde', label ='ETN', alpha=0.5)
EMR['returns'].plot(kind = 'kde', label ='EMR', alpha=0.5)
EFX['returns'].plot(kind = 'kde', label ='EFX', alpha=0.5)
EXPD['returns'].plot(kind = 'kde', label ='EXPD', alpha=0.5)
FAST['returns'].plot(kind = 'kde', label ='FAST', alpha=0.5)
FDX['returns'].plot(kind = 'kde', label ='FDX', alpha=0.5)
FLS['returns'].plot(kind = 'kde', label ='FLS', alpha=0.5)
FTV['returns'].plot(kind = 'kde', label ='FTV', alpha=0.5)
FBHS['returns'].plot(kind = 'kde', label ='FBHS', alpha=0.5)
GD['returns'].plot(kind = 'kde', label ='GD', alpha=0.5)
GE['returns'].plot(kind = 'kde', label ='GE', alpha=0.5)
GWW['returns'].plot(kind = 'kde', label ='GWW', alpha=0.5)
HON['returns'].plot(kind = 'kde', label ='HON', alpha=0.5)
HWM['returns'].plot(kind = 'kde', label ='HWM', alpha=0.5)
HII['returns'].plot(kind = 'kde', label ='HII', alpha=0.5)
IEX['returns'].plot(kind = 'kde', label ='IEX', alpha=0.5)
INFO['returns'].plot(kind = 'kde', label ='INFO', alpha=0.5)
ITW['returns'].plot(kind = 'kde', label ='ITW', alpha=0.5)
IR['returns'].plot(kind = 'kde', label ='IR', alpha=0.5)
J['returns'].plot(kind = 'kde', label ='J', alpha=0.5)
JBHT['returns'].plot(kind = 'kde', label ='JBHT', alpha=0.5)
JCI['returns'].plot(kind = 'kde', label ='JCI', alpha=0.5)
KSU['returns'].plot(kind = 'kde', label ='KSU', alpha=0.5)
LHX['returns'].plot(kind = 'kde', label ='LHX', alpha=0.5)
LMT['returns'].plot(kind = 'kde', label ='LMT', alpha=0.5)
MAS['returns'].plot(kind = 'kde', label ='MAS', alpha=0.5)
NLSN['returns'].plot(kind = 'kde', label ='NLSN', alpha=0.5)
NSC['returns'].plot(kind = 'kde', label ='NSC', alpha=0.5)
NOC['returns'].plot(kind = 'kde', label ='NOC', alpha=0.5)
ODFL['returns'].plot(kind = 'kde', label ='ODFL', alpha=0.5)
PCAR['returns'].plot(kind = 'kde', label ='PCAR', alpha=0.5)
PH['returns'].plot(kind = 'kde', label ='PH', alpha=0.5)
PNR['returns'].plot(kind = 'kde', label ='PNR', alpha=0.5)
PWR['returns'].plot(kind = 'kde', label ='PWR', alpha=0.5)
RTX['returns'].plot(kind = 'kde', label ='RTX', alpha=0.5)
RSG['returns'].plot(kind = 'kde', label ='RSG', alpha=0.5)
RHI['returns'].plot(kind = 'kde', label ='RHI', alpha=0.5)
ROK['returns'].plot(kind = 'kde', label ='ROK', alpha=0.5)
ROL['returns'].plot(kind = 'kde', label ='ROL', alpha=0.5)
ROP['returns'].plot(kind = 'kde', label ='ROP', alpha=0.5)
SNA['returns'].plot(kind = 'kde', label ='SNA', alpha=0.5)
LUV['returns'].plot(kind = 'kde', label ='LUV', alpha=0.5)
SWK['returns'].plot(kind = 'kde', label ='SWK', alpha=0.5)
TXT['returns'].plot(kind = 'kde', label ='TXT', alpha=0.5)
TT['returns'].plot(kind = 'kde', label ='TT', alpha=0.5)
TDG['returns'].plot(kind = 'kde', label ='TDG', alpha=0.5)
UNP['returns'].plot(kind = 'kde', label ='UNP', alpha=0.5)
UAL['returns'].plot(kind = 'kde', label ='UAL', alpha=0.5)
UPS['returns'].plot(kind = 'kde', label ='UPS', alpha=0.5)
URI['returns'].plot(kind = 'kde', label ='URI', alpha=0.5)
VRSK['returns'].plot(kind = 'kde', label ='VRSK', alpha=0.5)
WAB['returns'].plot(kind = 'kde', label ='WAB', alpha=0.5)
WM['returns'].plot(kind = 'kde', label ='WM', alpha=0.5)
XYL['returns'].plot(kind = 'kde', label ='XYL', alpha=0.5)
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Boxplots comparing returns for Industrials Sector
box_df = pd.concat([sp['returns'],MMM['returns'],ALK['returns'],ALLE['returns'],AAL['returns'],AME['returns'],AOS['returns'],BA['returns'],CHRW['returns'],CAT['returns'],CTAS['returns'],CPRT['returns'],CSX['returns'],CMI['returns'],DE['returns'],DAL['returns'],DOV['returns'],ETN['returns'],EMR['returns'],EFX['returns'],EXPD['returns'],FAST['returns'],FDX['returns'],FLS['returns'],FTV['returns'],FBHS['returns'],GD['returns'],GE['returns'],GWW['returns'],HON['returns'],HWM['returns'],HII['returns'],IEX['returns'],INFO['returns'],ITW['returns'],IR['returns'],J['returns'],JBHT['returns'],JCI['returns'],KSU['returns'],LHX['returns'],LMT['returns'],MAS['returns'],NLSN['returns'],NSC['returns'],NOC['returns'],ODFL['returns'],PCAR['returns'],PH['returns'],PNR['returns'],PWR['returns'],RTX['returns'],RSG['returns'],RHI['returns'],ROK['returns'],ROL['returns'],ROP['returns'],SNA['returns'],LUV['returns'],SWK['returns'],TXT['returns'],TT['returns'],TDG['returns'],UNP['returns'],UAL['returns'],UPS['returns'],URI['returns'],VRSK['returns'],WAB['returns'],WM['returns'],XYL['returns']], axis=1)
box_df.columns = ['S&P 500','MMM','ALK','ALLE','AAL','AME','AOS','BA','CHRW','CAT','CTAS','CPRT','CSX','CMI','DE','DAL','DOV','ETN','EMR','EFX','EXPD','FAST','FDX','FLS','FTV','FBHS','GD','GE','GWW','HON','HWM','HII','IEX','INFO','ITW','IR','J','JBHT','JCI','KSU','LHX','LMT','MAS','NLSN','NSC','NOC','ODFL','PCAR','PH','PNR','PWR','RTX','RSG','RHI','ROK','ROL','ROP','SNA','LUV','SWK','TXT','TT','TDG','UNP','UAL','UPS','URI','VRSK','WAB','WM','XYL']
box_df.plot(kind='box', figsize=(30,10), colormap= 'jet', title = 'Boxplots of Industrials Sector Returns')
#Cumulative Returns of Industrials Stocks for Whole period
sp['Cumulative Return'].plot(label="S&P 500")
MMM['Cumulative Return'].plot(label='MMM', figsize=(16,8), title = 'Cumulative Return of Industrials Stocks')
ALK['Cumulative Return'].plot(label="ALK")
ALLE['Cumulative Return'].plot(label="ALLE")
AAL['Cumulative Return'].plot(label="AAL")
AME['Cumulative Return'].plot(label="AME")
AOS['Cumulative Return'].plot(label="AOS")
BA['Cumulative Return'].plot(label="BA")
CHRW['Cumulative Return'].plot(label="CHRW")
CAT['Cumulative Return'].plot(label="CAT")
CTAS['Cumulative Return'].plot(label="CTAS")
CPRT['Cumulative Return'].plot(label="CPRT")
CSX['Cumulative Return'].plot(label="CSX")
CMI['Cumulative Return'].plot(label="CMI")
DE['Cumulative Return'].plot(label="DE")
DAL['Cumulative Return'].plot(label="DAL")
DOV['Cumulative Return'].plot(label="DOV")
ETN['Cumulative Return'].plot(label="ETN")
EMR['Cumulative Return'].plot(label="EMR")
EFX['Cumulative Return'].plot(label="EFX")
EXPD['Cumulative Return'].plot(label="EXPD")
FAST['Cumulative Return'].plot(label="FAST")
FDX['Cumulative Return'].plot(label="FDX")
FLS['Cumulative Return'].plot(label="FLS")
FTV['Cumulative Return'].plot(label="FTV")
FBHS['Cumulative Return'].plot(label="FBHS")
GD['Cumulative Return'].plot(label="GD")
GE['Cumulative Return'].plot(label="GE")
GWW['Cumulative Return'].plot(label="GWW")
HON['Cumulative Return'].plot(label="HON")
HWM['Cumulative Return'].plot(label="HWM")
HII['Cumulative Return'].plot(label="HII")
IEX['Cumulative Return'].plot(label="IEX")
INFO['Cumulative Return'].plot(label="INFO")
ITW['Cumulative Return'].plot(label="ITW")
IR['Cumulative Return'].plot(label="IR")
J['Cumulative Return'].plot(label="J")
JBHT['Cumulative Return'].plot(label="JBHT")
JCI['Cumulative Return'].plot(label="JCI")
KSU['Cumulative Return'].plot(label="KSU")
LHX['Cumulative Return'].plot(label="LHX")
LMT['Cumulative Return'].plot(label="LMT")
MAS['Cumulative Return'].plot(label="MAS")
NLSN['Cumulative Return'].plot(label="NLSN")
NSC['Cumulative Return'].plot(label="NSC")
NOC['Cumulative Return'].plot(label="NOC")
ODFL['Cumulative Return'].plot(label="ODFL")
PCAR['Cumulative Return'].plot(label="PCAR")
PH['Cumulative Return'].plot(label="PH")
PNR['Cumulative Return'].plot(label="PNR")
PWR['Cumulative Return'].plot(label="PWR")
RTX['Cumulative Return'].plot(label="RTX")
RSG['Cumulative Return'].plot(label="RSG")
RHI['Cumulative Return'].plot(label="RHI")
ROK['Cumulative Return'].plot(label="ROK")
ROL['Cumulative Return'].plot(label="ROL")
ROP['Cumulative Return'].plot(label="ROP")
SNA['Cumulative Return'].plot(label="SNA")
LUV['Cumulative Return'].plot(label="LUV")
SWK['Cumulative Return'].plot(label="SWK")
TXT['Cumulative Return'].plot(label="TXT")
TT['Cumulative Return'].plot(label="TT")
TDG['Cumulative Return'].plot(label="TDG")
UNP['Cumulative Return'].plot(label="UNP")
UAL['Cumulative Return'].plot(label="UAL")
UPS['Cumulative Return'].plot(label="UPS")
URI['Cumulative Return'].plot(label="URI")
VRSK['Cumulative Return'].plot(label="VRSK")
WAB['Cumulative Return'].plot(label="WAB")
WM['Cumulative Return'].plot(label="WM")
XYL['Cumulative Return'].plot(label="XYL")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Sorting by Cumulative Return
cumret = {'Cumulative Returns 12/4-6/5': [sp['Cumulative Return'].iloc[-1],MMM['Cumulative Return'].iloc[-1],ALK['Cumulative Return'].iloc[-1],ALLE['Cumulative Return'].iloc[-1],AAL['Cumulative Return'].iloc[-1],AME['Cumulative Return'].iloc[-1],AOS['Cumulative Return'].iloc[-1],BA['Cumulative Return'].iloc[-1],CHRW['Cumulative Return'].iloc[-1],CAT['Cumulative Return'].iloc[-1],CTAS['Cumulative Return'].iloc[-1],CPRT['Cumulative Return'].iloc[-1],CSX['Cumulative Return'].iloc[-1],CMI['Cumulative Return'].iloc[-1],DE['Cumulative Return'].iloc[-1],DAL['Cumulative Return'].iloc[-1],DOV['Cumulative Return'].iloc[-1],ETN['Cumulative Return'].iloc[-1],EMR['Cumulative Return'].iloc[-1],EFX['Cumulative Return'].iloc[-1],EXPD['Cumulative Return'].iloc[-1],FAST['Cumulative Return'].iloc[-1],FDX['Cumulative Return'].iloc[-1],FLS['Cumulative Return'].iloc[-1],FTV['Cumulative Return'].iloc[-1],FBHS['Cumulative Return'].iloc[-1],GD['Cumulative Return'].iloc[-1],GE['Cumulative Return'].iloc[-1],GWW['Cumulative Return'].iloc[-1],HON['Cumulative Return'].iloc[-1],HWM['Cumulative Return'].iloc[-1],HII['Cumulative Return'].iloc[-1],IEX['Cumulative Return'].iloc[-1],INFO['Cumulative Return'].iloc[-1],ITW['Cumulative Return'].iloc[-1],IR['Cumulative Return'].iloc[-1],J['Cumulative Return'].iloc[-1],JBHT['Cumulative Return'].iloc[-1],JCI['Cumulative Return'].iloc[-1],KSU['Cumulative Return'].iloc[-1],LHX['Cumulative Return'].iloc[-1],LMT['Cumulative Return'].iloc[-1],MAS['Cumulative Return'].iloc[-1],NLSN['Cumulative Return'].iloc[-1],NSC['Cumulative Return'].iloc[-1],NOC['Cumulative Return'].iloc[-1],ODFL['Cumulative Return'].iloc[-1],PCAR['Cumulative Return'].iloc[-1],PH['Cumulative Return'].iloc[-1],PNR['Cumulative Return'].iloc[-1],PWR['Cumulative Return'].iloc[-1],RTX['Cumulative Return'].iloc[-1],RSG['Cumulative Return'].iloc[-1],RHI['Cumulative Return'].iloc[-1],ROK['Cumulative Return'].iloc[-1],ROL['Cumulative Return'].iloc[-1],ROP['Cumulative Return'].iloc[-1],SNA['Cumulative Return'].iloc[-1],LUV['Cumulative Return'].iloc[-1],SWK['Cumulative Return'].iloc[-1],TXT['Cumulative Return'].iloc[-1],TT['Cumulative Return'].iloc[-1],TDG['Cumulative Return'].iloc[-1],UNP['Cumulative Return'].iloc[-1],UAL['Cumulative Return'].iloc[-1],UPS['Cumulative Return'].iloc[-1],URI['Cumulative Return'].iloc[-1],VRSK['Cumulative Return'].iloc[-1],WAB['Cumulative Return'].iloc[-1],WM['Cumulative Return'].iloc[-1],XYL['Cumulative Return'].iloc[-1]],
'Cumulative Returns 12/4-2/20': [spbef['Cumulative Return Before Crash'].iloc[-1],MMMbef['Cumulative Return Before Crash'].iloc[-1],ALKbef['Cumulative Return Before Crash'].iloc[-1],ALLEbef['Cumulative Return Before Crash'].iloc[-1],AALbef['Cumulative Return Before Crash'].iloc[-1],AMEbef['Cumulative Return Before Crash'].iloc[-1],AOSbef['Cumulative Return Before Crash'].iloc[-1],BAbef['Cumulative Return Before Crash'].iloc[-1],CHRWbef['Cumulative Return Before Crash'].iloc[-1],CATbef['Cumulative Return Before Crash'].iloc[-1],CTASbef['Cumulative Return Before Crash'].iloc[-1],CPRTbef['Cumulative Return Before Crash'].iloc[-1],CSXbef['Cumulative Return Before Crash'].iloc[-1],CMIbef['Cumulative Return Before Crash'].iloc[-1],DEbef['Cumulative Return Before Crash'].iloc[-1],DALbef['Cumulative Return Before Crash'].iloc[-1],DOVbef['Cumulative Return Before Crash'].iloc[-1],ETNbef['Cumulative Return Before Crash'].iloc[-1],EMRbef['Cumulative Return Before Crash'].iloc[-1],EFXbef['Cumulative Return Before Crash'].iloc[-1],EXPDbef['Cumulative Return Before Crash'].iloc[-1],FASTbef['Cumulative Return Before Crash'].iloc[-1],FDXbef['Cumulative Return Before Crash'].iloc[-1],FLSbef['Cumulative Return Before Crash'].iloc[-1],FTVbef['Cumulative Return Before Crash'].iloc[-1],FBHSbef['Cumulative Return Before Crash'].iloc[-1],GDbef['Cumulative Return Before Crash'].iloc[-1],GEbef['Cumulative Return Before Crash'].iloc[-1],GWWbef['Cumulative Return Before Crash'].iloc[-1],HONbef['Cumulative Return Before Crash'].iloc[-1],HWMbef['Cumulative Return Before Crash'].iloc[-1],HIIbef['Cumulative Return Before Crash'].iloc[-1],IEXbef['Cumulative Return Before Crash'].iloc[-1],INFObef['Cumulative Return Before Crash'].iloc[-1],ITWbef['Cumulative Return Before Crash'].iloc[-1],IRbef['Cumulative Return Before Crash'].iloc[-1],Jbef['Cumulative Return Before Crash'].iloc[-1],JBHTbef['Cumulative Return Before Crash'].iloc[-1],JCIbef['Cumulative Return Before Crash'].iloc[-1],KSUbef['Cumulative Return Before Crash'].iloc[-1],LHXbef['Cumulative Return Before Crash'].iloc[-1],LMTbef['Cumulative Return Before Crash'].iloc[-1],MASbef['Cumulative Return Before Crash'].iloc[-1],NLSNbef['Cumulative Return Before Crash'].iloc[-1],NSCbef['Cumulative Return Before Crash'].iloc[-1],NOCbef['Cumulative Return Before Crash'].iloc[-1],ODFLbef['Cumulative Return Before Crash'].iloc[-1],PCARbef['Cumulative Return Before Crash'].iloc[-1],PHbef['Cumulative Return Before Crash'].iloc[-1],PNRbef['Cumulative Return Before Crash'].iloc[-1],PWRbef['Cumulative Return Before Crash'].iloc[-1],RTXbef['Cumulative Return Before Crash'].iloc[-1],RSGbef['Cumulative Return Before Crash'].iloc[-1],RHIbef['Cumulative Return Before Crash'].iloc[-1],ROKbef['Cumulative Return Before Crash'].iloc[-1],ROLbef['Cumulative Return Before Crash'].iloc[-1],ROPbef['Cumulative Return Before Crash'].iloc[-1],SNAbef['Cumulative Return Before Crash'].iloc[-1],LUVbef['Cumulative Return Before Crash'].iloc[-1],SWKbef['Cumulative Return Before Crash'].iloc[-1],TXTbef['Cumulative Return Before Crash'].iloc[-1],TTbef['Cumulative Return Before Crash'].iloc[-1],TDGbef['Cumulative Return Before Crash'].iloc[-1],UNPbef['Cumulative Return Before Crash'].iloc[-1],UALbef['Cumulative Return Before Crash'].iloc[-1],UPSbef['Cumulative Return Before Crash'].iloc[-1],URIbef['Cumulative Return Before Crash'].iloc[-1],VRSKbef['Cumulative Return Before Crash'].iloc[-1],WABbef['Cumulative Return Before Crash'].iloc[-1],WMbef['Cumulative Return Before Crash'].iloc[-1],XYLbef['Cumulative Return Before Crash'].iloc[-1]],
'Cumulative Returns 2/20-3/23': [spdur['Cumulative Return During Crash'].iloc[-1],MMMdur['Cumulative Return During Crash'].iloc[-1],ALKdur['Cumulative Return During Crash'].iloc[-1],ALLEdur['Cumulative Return During Crash'].iloc[-1],AALdur['Cumulative Return During Crash'].iloc[-1],AMEdur['Cumulative Return During Crash'].iloc[-1],AOSdur['Cumulative Return During Crash'].iloc[-1],BAdur['Cumulative Return During Crash'].iloc[-1],CHRWdur['Cumulative Return During Crash'].iloc[-1],CATdur['Cumulative Return During Crash'].iloc[-1],CTASdur['Cumulative Return During Crash'].iloc[-1],CPRTdur['Cumulative Return During Crash'].iloc[-1],CSXdur['Cumulative Return During Crash'].iloc[-1],CMIdur['Cumulative Return During Crash'].iloc[-1],DEdur['Cumulative Return During Crash'].iloc[-1],DALdur['Cumulative Return During Crash'].iloc[-1],DOVdur['Cumulative Return During Crash'].iloc[-1],ETNdur['Cumulative Return During Crash'].iloc[-1],EMRdur['Cumulative Return During Crash'].iloc[-1],EFXdur['Cumulative Return During Crash'].iloc[-1],EXPDdur['Cumulative Return During Crash'].iloc[-1],FASTdur['Cumulative Return During Crash'].iloc[-1],FDXdur['Cumulative Return During Crash'].iloc[-1],FLSdur['Cumulative Return During Crash'].iloc[-1],FTVdur['Cumulative Return During Crash'].iloc[-1],FBHSdur['Cumulative Return During Crash'].iloc[-1],GDdur['Cumulative Return During Crash'].iloc[-1],GEdur['Cumulative Return During Crash'].iloc[-1],GWWdur['Cumulative Return During Crash'].iloc[-1],HONdur['Cumulative Return During Crash'].iloc[-1],HWMdur['Cumulative Return During Crash'].iloc[-1],HIIdur['Cumulative Return During Crash'].iloc[-1],IEXdur['Cumulative Return During Crash'].iloc[-1],INFOdur['Cumulative Return During Crash'].iloc[-1],ITWdur['Cumulative Return During Crash'].iloc[-1],IRdur['Cumulative Return During Crash'].iloc[-1],Jdur['Cumulative Return During Crash'].iloc[-1],JBHTdur['Cumulative Return During Crash'].iloc[-1],JCIdur['Cumulative Return During Crash'].iloc[-1],KSUdur['Cumulative Return During Crash'].iloc[-1],LHXdur['Cumulative Return During Crash'].iloc[-1],LMTdur['Cumulative Return During Crash'].iloc[-1],MASdur['Cumulative Return During Crash'].iloc[-1],NLSNdur['Cumulative Return During Crash'].iloc[-1],NSCdur['Cumulative Return During Crash'].iloc[-1],NOCdur['Cumulative Return During Crash'].iloc[-1],ODFLdur['Cumulative Return During Crash'].iloc[-1],PCARdur['Cumulative Return During Crash'].iloc[-1],PHdur['Cumulative Return During Crash'].iloc[-1],PNRdur['Cumulative Return During Crash'].iloc[-1],PWRdur['Cumulative Return During Crash'].iloc[-1],RTXdur['Cumulative Return During Crash'].iloc[-1],RSGdur['Cumulative Return During Crash'].iloc[-1],RHIdur['Cumulative Return During Crash'].iloc[-1],ROKdur['Cumulative Return During Crash'].iloc[-1],ROLdur['Cumulative Return During Crash'].iloc[-1],ROPdur['Cumulative Return During Crash'].iloc[-1],SNAdur['Cumulative Return During Crash'].iloc[-1],LUVdur['Cumulative Return During Crash'].iloc[-1],SWKdur['Cumulative Return During Crash'].iloc[-1],TXTdur['Cumulative Return During Crash'].iloc[-1],TTdur['Cumulative Return During Crash'].iloc[-1],TDGdur['Cumulative Return During Crash'].iloc[-1],UNPdur['Cumulative Return During Crash'].iloc[-1],UALdur['Cumulative Return During Crash'].iloc[-1],UPSdur['Cumulative Return During Crash'].iloc[-1],URIdur['Cumulative Return During Crash'].iloc[-1],VRSKdur['Cumulative Return During Crash'].iloc[-1],WABdur['Cumulative Return During Crash'].iloc[-1],WMdur['Cumulative Return During Crash'].iloc[-1],XYLdur['Cumulative Return During Crash'].iloc[-1]],
'Cumulative Returns 3/23-6/5': [spaft['Cumulative Return After Crash'].iloc[-1],MMMaft['Cumulative Return After Crash'].iloc[-1],ALKaft['Cumulative Return After Crash'].iloc[-1],ALLEaft['Cumulative Return After Crash'].iloc[-1],AALaft['Cumulative Return After Crash'].iloc[-1],AMEaft['Cumulative Return After Crash'].iloc[-1],AOSaft['Cumulative Return After Crash'].iloc[-1],BAaft['Cumulative Return After Crash'].iloc[-1],CHRWaft['Cumulative Return After Crash'].iloc[-1],CATaft['Cumulative Return After Crash'].iloc[-1],CTASaft['Cumulative Return After Crash'].iloc[-1],CPRTaft['Cumulative Return After Crash'].iloc[-1],CSXaft['Cumulative Return After Crash'].iloc[-1],CMIaft['Cumulative Return After Crash'].iloc[-1],DEaft['Cumulative Return After Crash'].iloc[-1],DALaft['Cumulative Return After Crash'].iloc[-1],DOVaft['Cumulative Return After Crash'].iloc[-1],ETNaft['Cumulative Return After Crash'].iloc[-1],EMRaft['Cumulative Return After Crash'].iloc[-1],EFXaft['Cumulative Return After Crash'].iloc[-1],EXPDaft['Cumulative Return After Crash'].iloc[-1],FASTaft['Cumulative Return After Crash'].iloc[-1],FDXaft['Cumulative Return After Crash'].iloc[-1],FLSaft['Cumulative Return After Crash'].iloc[-1],FTVaft['Cumulative Return After Crash'].iloc[-1],FBHSaft['Cumulative Return After Crash'].iloc[-1],GDaft['Cumulative Return After Crash'].iloc[-1],GEaft['Cumulative Return After Crash'].iloc[-1],GWWaft['Cumulative Return After Crash'].iloc[-1],HONaft['Cumulative Return After Crash'].iloc[-1],HWMaft['Cumulative Return After Crash'].iloc[-1],HIIaft['Cumulative Return After Crash'].iloc[-1],IEXaft['Cumulative Return After Crash'].iloc[-1],INFOaft['Cumulative Return After Crash'].iloc[-1],ITWaft['Cumulative Return After Crash'].iloc[-1],IRaft['Cumulative Return After Crash'].iloc[-1],Jaft['Cumulative Return After Crash'].iloc[-1],JBHTaft['Cumulative Return After Crash'].iloc[-1],JCIaft['Cumulative Return After Crash'].iloc[-1],KSUaft['Cumulative Return After Crash'].iloc[-1],LHXaft['Cumulative Return After Crash'].iloc[-1],LMTaft['Cumulative Return After Crash'].iloc[-1],MASaft['Cumulative Return After Crash'].iloc[-1],NLSNaft['Cumulative Return After Crash'].iloc[-1],NSCaft['Cumulative Return After Crash'].iloc[-1],NOCaft['Cumulative Return After Crash'].iloc[-1],ODFLaft['Cumulative Return After Crash'].iloc[-1],PCARaft['Cumulative Return After Crash'].iloc[-1],PHaft['Cumulative Return After Crash'].iloc[-1],PNRaft['Cumulative Return After Crash'].iloc[-1],PWRaft['Cumulative Return After Crash'].iloc[-1],RTXaft['Cumulative Return After Crash'].iloc[-1],RSGaft['Cumulative Return After Crash'].iloc[-1],RHIaft['Cumulative Return After Crash'].iloc[-1],ROKaft['Cumulative Return After Crash'].iloc[-1],ROLaft['Cumulative Return After Crash'].iloc[-1],ROPaft['Cumulative Return After Crash'].iloc[-1],SNAaft['Cumulative Return After Crash'].iloc[-1],LUVaft['Cumulative Return After Crash'].iloc[-1],SWKaft['Cumulative Return After Crash'].iloc[-1],TXTaft['Cumulative Return After Crash'].iloc[-1],TTaft['Cumulative Return After Crash'].iloc[-1],TDGaft['Cumulative Return After Crash'].iloc[-1],UNPaft['Cumulative Return After Crash'].iloc[-1],UALaft['Cumulative Return After Crash'].iloc[-1],UPSaft['Cumulative Return After Crash'].iloc[-1],URIaft['Cumulative Return After Crash'].iloc[-1],VRSKaft['Cumulative Return After Crash'].iloc[-1],WABaft['Cumulative Return After Crash'].iloc[-1],WMaft['Cumulative Return After Crash'].iloc[-1],XYLaft['Cumulative Return After Crash'].iloc[-1]]}
inddf2 = pd.DataFrame(cumret, columns = ['Cumulative Returns 12/4-6/5', 'Cumulative Returns 12/4-2/20', 'Cumulative Returns 2/20-3/23', 'Cumulative Returns 3/23-6/5'], index= ['S&P 500','MMM','ALK','ALLE','AAL','AME','AOS','BA','CHRW','CAT','CTAS','CPRT','CSX','CMI','DE','DAL','DOV','ETN','EMR','EFX','EXPD','FAST','FDX','FLS','FTV','FBHS','GD','GE','GWW','HON','HWM','HII','IEX','INFO','ITW','IR','J','JBHT','JCI','KSU','LHX','LMT','MAS','NLSN','NSC','NOC','ODFL','PCAR','PH','PNR','PWR','RTX','RSG','RHI','ROK','ROL','ROP','SNA','LUV','SWK','TXT','TT','TDG','UNP','UAL','UPS','URI','VRSK','WAB','WM','XYL'])
pd.DataFrame(inddf2)
inddf2.sort_values('Cumulative Returns 3/23-6/5', ascending=False)
#Table of Key Statistics of Industrials Stocks
import pandas as pd
import statistics as stats
indmeans = [MMMmean,ALKmean,ALLEmean,AALmean,AMEmean,AOSmean,BAmean,CHRWmean,CATmean,CTASmean,CPRTmean,CSXmean,CMImean,DEmean,DALmean,DOVmean,ETNmean,EMRmean,EFXmean,EXPDmean,FASTmean,FDXmean,FLSmean,FTVmean,FBHSmean,GDmean,GEmean,GWWmean,HONmean,HWMmean,HIImean,IEXmean,INFOmean,ITWmean,IRmean,Jmean,JBHTmean,JCImean,KSUmean,LHXmean,LMTmean,MASmean,NLSNmean,NSCmean,NOCmean,ODFLmean,PCARmean,PHmean,PNRmean,PWRmean,RTXmean,RSGmean,RHImean,ROKmean,ROLmean,ROPmean,SNAmean,LUVmean,SWKmean,TXTmean,TTmean,TDGmean,UNPmean,UALmean,UPSmean,URImean,VRSKmean,WABmean,WMmean,XYLmean]
indaveragemean = stats.mean(indmeans)
indvariances = [MMMvar,ALKvar,ALLEvar,AALvar,AMEvar,AOSvar,BAvar,CHRWvar,CATvar,CTASvar,CPRTvar,CSXvar,CMIvar,DEvar,DALvar,DOVvar,ETNvar,EMRvar,EFXvar,EXPDvar,FASTvar,FDXvar,FLSvar,FTVvar,FBHSvar,GDvar,GEvar,GWWvar,HONvar,HWMvar,HIIvar,IEXvar,INFOvar,ITWvar,IRvar,Jvar,JBHTvar,JCIvar,KSUvar,LHXvar,LMTvar,MASvar,NLSNvar,NSCvar,NOCvar,ODFLvar,PCARvar,PHvar,PNRvar,PWRvar,RTXvar,RSGvar,RHIvar,ROKvar,ROLvar,ROPvar,SNAvar,LUVvar,SWKvar,TXTvar,TTvar,TDGvar,UNPvar,UALvar,UPSvar,URIvar,VRSKvar,WABvar,WMvar,XYLvar]
indaveragevar = stats.mean(indvariances)
indkurtoses = [MMMkurt,ALKkurt,ALLEkurt,AALkurt,AMEkurt,AOSkurt,BAkurt,CHRWkurt,CATkurt,CTASkurt,CPRTkurt,CSXkurt,CMIkurt,DEkurt,DALkurt,DOVkurt,ETNkurt,EMRkurt,EFXkurt,EXPDkurt,FASTkurt,FDXkurt,FLSkurt,FTVkurt,FBHSkurt,GDkurt,GEkurt,GWWkurt,HONkurt,HWMkurt,HIIkurt,IEXkurt,INFOkurt,ITWkurt,IRkurt,Jkurt,JBHTkurt,JCIkurt,KSUkurt,LHXkurt,LMTkurt,MASkurt,NLSNkurt,NSCkurt,NOCkurt,ODFLkurt,PCARkurt,PHkurt,PNRkurt,PWRkurt,RTXkurt,RSGkurt,RHIkurt,ROKkurt,ROLkurt,ROPkurt,SNAkurt,LUVkurt,SWKkurt,TXTkurt,TTkurt,TDGkurt,UNPkurt,UALkurt,UPSkurt,URIkurt,VRSKkurt,WABkurt,WMkurt,XYLkurt]
indaveragekurt = stats.mean(indkurtoses)
indskews = [MMMskew,ALKskew,ALLEskew,AALskew,AMEskew,AOSskew,BAskew,CHRWskew,CATskew,CTASskew,CPRTskew,CSXskew,CMIskew,DEskew,DALskew,DOVskew,ETNskew,EMRskew,EFXskew,EXPDskew,FASTskew,FDXskew,FLSskew,FTVskew,FBHSskew,GDskew,GEskew,GWWskew,HONskew,HWMskew,HIIskew,IEXskew,INFOskew,ITWskew,IRskew,Jskew,JBHTskew,JCIskew,KSUskew,LHXskew,LMTskew,MASskew,NLSNskew,NSCskew,NOCskew,ODFLskew,PCARskew,PHskew,PNRskew,PWRskew,RTXskew,RSGskew,RHIskew,ROKskew,ROLskew,ROPskew,SNAskew,LUVskew,SWKskew,TXTskew,TTskew,TDGskew,UNPskew,UALskew,UPSskew,URIskew,VRSKskew,WABskew,WMskew,XYLskew]
indaverageskew = stats.mean(indskews)
Industrials = {'Mean': [[spmean],[indaveragemean],[MMMmean], [ALKmean],[ALLEmean],[AALmean],[AMEmean],[AOSmean],[BAmean],[CHRWmean],[CATmean],[CTASmean],[CPRTmean],[CSXmean],[CMImean],[DEmean],[DALmean],[DOVmean],[ETNmean],[EMRmean],[EFXmean],[EXPDmean],[FASTmean],[FDXmean],[FLSmean],[FTVmean],[FBHSmean],[GDmean],[GEmean], [GWWmean],[HONmean],[HWMmean],[HIImean],[IEXmean],[INFOmean],[ITWmean],[IRmean],[Jmean],[JBHTmean],[JCImean],[KSUmean],[LHXmean],[LMTmean],[MASmean],[NLSNmean],[NSCmean],[NOCmean],[ODFLmean],[PCARmean],[PHmean],[PNRmean],[PWRmean],[RTXmean],[RSGmean],[RHImean],[ROKmean],[ROLmean],[ROPmean],[SNAmean],[LUVmean],[SWKmean],[TXTmean],[TTmean],[TDGmean],[UNPmean],[UALmean],[UPSmean],[URImean],[VRSKmean],[WABmean],[WMmean],[XYLmean]],
'Variance': [[spvar],[indaveragevar],[MMMvar],[ALKvar],[ALLEvar],[AALvar],[AMEvar],[AOSvar],[BAvar],[CHRWvar],[CATvar],[CTASvar],[CPRTvar],[CSXvar],[CMIvar],[DEvar],[DALvar],[DOVvar],[ETNvar],[EMRvar],[EFXvar],[EXPDvar],[FASTvar],[FDXvar],[FLSvar],[FTVvar],[FBHSvar],[GDvar],[GEvar],[GWWvar],[HONvar],[HWMvar],[HIIvar],[IEXvar],[INFOvar],[ITWvar],[IRvar],[Jvar],[JBHTvar],[JCIvar],[KSUvar],[LHXvar],[LMTvar],[MASvar],[NLSNvar],[NSCvar],[NOCvar],[ODFLvar],[PCARvar],[PHvar],[PNRvar],[PWRvar],[RTXvar],[RSGvar],[RHIvar],[ROKvar],[ROLvar],[ROPvar],[SNAvar],[LUVvar],[SWKvar],[TXTvar],[TTvar],[TDGvar],[UNPvar],[UALvar],[UPSvar],[URIvar],[VRSKvar],[WABvar],[WMvar],[XYLvar]],
'Kurtosis': [[spkurt],[indaveragekurt],[MMMkurt],[ALKkurt],[ALLEkurt],[AALkurt],[AMEkurt],[AOSkurt],[BAkurt],[CHRWkurt],[CATkurt],[CTASkurt],[CPRTkurt],[CSXkurt],[CMIkurt],[DEkurt],[DALkurt],[DOVkurt],[ETNkurt],[EMRkurt],[EFXkurt],[EXPDkurt],[FASTkurt],[FDXkurt],[FLSkurt],[FTVkurt],[FBHSkurt],[GDkurt],[GEkurt],[GWWkurt],[HONkurt],[HWMkurt],[HIIkurt],[IEXkurt],[INFOkurt],[ITWkurt],[IRkurt],[Jkurt],[JBHTkurt],[JCIkurt],[KSUkurt],[LHXkurt],[LMTkurt],[MASkurt],[NLSNkurt],[NSCkurt],[NOCkurt],[ODFLkurt],[PCARkurt],[PHkurt],[PNRkurt],[PWRkurt],[RTXkurt],[RSGkurt],[RHIkurt],[ROKkurt],[ROLkurt],[ROPkurt],[SNAkurt],[LUVkurt],[SWKkurt],[TXTkurt],[TTkurt],[TDGkurt],[UNPkurt],[UALkurt],[UPSkurt],[URIkurt],[VRSKkurt],[WABkurt],[WMkurt],[XYLkurt]],
'Skew': [[spskew],[indaverageskew],[MMMskew],[ALKskew],[ALLEskew],[AALskew],[AMEskew],[AOSskew],[BAskew],[CHRWskew],[CATskew],[CTASskew],[CPRTskew],[CSXskew],[CMIskew],[DEskew],[DALskew],[DOVskew],[ETNskew],[EMRskew],[EFXskew],[EXPDskew],[FASTskew],[FDXskew],[FLSskew],[FTVskew],[FBHSskew],[GDskew],[GEskew],[GWWskew],[HONskew],[HWMskew],[HIIskew],[IEXskew],[INFOskew],[ITWskew],[IRskew],[Jskew],[JBHTskew],[JCIskew],[KSUskew],[LHXskew],[LMTskew],[MASskew],[NLSNskew],[NSCskew],[NOCskew],[ODFLskew],[PCARskew],[PHskew],[PNRskew],[PWRskew],[RTXskew],[RSGskew],[RHIskew],[ROKskew],[ROLskew],[ROPskew],[SNAskew],[LUVskew],[SWKskew],[TXTskew],[TTskew],[TDGskew],[UNPskew],[UALskew],[UPSskew],[URIskew],[VRSKskew],[WABskew],[WMskew],[XYLskew]],
}
inddf = pd.DataFrame(Industrials, columns = ['Mean', 'Variance', 'Kurtosis', 'Skew'], index= ['S&P 500','Average','MMM','ALK','ALLE','AAL','AME','AOS','BA','CHRW','CAT','CTAS','CPRT','CSX','CMI','DE','DAL','DOV','ETN','EMR','EFX','EXPD','FAST','FDX','FLS','FTV','FBHS','GD','GE','GWW','HON','HWM','HII','IEX','INFO','ITW','IR','J','JBHT','JCI','KSU','LHX','LMT','MAS','NLSN','NSC','NOC','ODFL','PCAR','PH','PNR','PWR','RTX','RSG','RHI','ROK','ROL','ROP','SNA','LUV','SWK','TXT','TT','TDG','UNP','UAL','UPS','URI','VRSK','WAB','WM','XYL']
)
pd.DataFrame(inddf)
inddf.sort_values("Mean", ascending=False)
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AAP = web.DataReader('AAP', 'yahoo', start, end)
AAP['returns'] = AAP['Close'].pct_change(1)
AAP['Cumulative Return'] = (1 + AAP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AAPmean = AAP['returns'].mean()
AAPvar = AAP['returns'].var()
AAPkurt = AAP['returns'].kurt()
AAPskew = AAP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AAPbef = web.DataReader('AAP', 'yahoo', start, crashstart)
AAPbef['avgreturnbefore'] = AAPbef['Close'].pct_change(1)
AAPbef['Cumulative Return Before Crash'] = (1 + AAPbef['avgreturnbefore']).cumprod()
#period of crash
AAPdur = web.DataReader('AAP', 'yahoo', crashstart, crashend)
AAPdur['avgreturnduring'] = AAPdur['Close'].pct_change(1)
AAPdur['Cumulative Return During Crash'] = (1 + AAPdur['avgreturnduring']).cumprod()
#period after crash
AAPaft = web.DataReader('AAP', 'yahoo', crashend, end)
AAPaft['avgreturnafter'] = AAPaft['Close'].pct_change(1)
AAPaft['Cumulative Return After Crash'] = (1 + AAPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AMZN = web.DataReader('AMZN', 'yahoo', start, end)
AMZN['returns'] = AMZN['Close'].pct_change(1)
AMZN['Cumulative Return'] = (1 + AMZN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AMZNmean = AMZN['returns'].mean()
AMZNvar = AMZN['returns'].var()
AMZNkurt = AMZN['returns'].kurt()
AMZNskew = AMZN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AMZNbef = web.DataReader('AMZN', 'yahoo', start, crashstart)
AMZNbef['avgreturnbefore'] = AMZNbef['Close'].pct_change(1)
AMZNbef['Cumulative Return Before Crash'] = (1 + AMZNbef['avgreturnbefore']).cumprod()
#period of crash
AMZNdur = web.DataReader('AMZN', 'yahoo', crashstart, crashend)
AMZNdur['avgreturnduring'] = AMZNdur['Close'].pct_change(1)
AMZNdur['Cumulative Return During Crash'] = (1 + AMZNdur['avgreturnduring']).cumprod()
#period after crash
AMZNaft = web.DataReader('AMZN', 'yahoo', crashend, end)
AMZNaft['avgreturnafter'] = AMZNaft['Close'].pct_change(1)
AMZNaft['Cumulative Return After Crash'] = (1 + AMZNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
APTV = web.DataReader('APTV', 'yahoo', start, end)
APTV['returns'] = APTV['Close'].pct_change(1)
APTV['Cumulative Return'] = (1 + APTV['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
APTVmean = APTV['returns'].mean()
APTVvar = APTV['returns'].var()
APTVkurt = APTV['returns'].kurt()
APTVskew = APTV['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
APTVbef = web.DataReader('APTV', 'yahoo', start, crashstart)
APTVbef['avgreturnbefore'] = APTVbef['Close'].pct_change(1)
APTVbef['Cumulative Return Before Crash'] = (1 + APTVbef['avgreturnbefore']).cumprod()
#period of crash
APTVdur = web.DataReader('APTV', 'yahoo', crashstart, crashend)
APTVdur['avgreturnduring'] = APTVdur['Close'].pct_change(1)
APTVdur['Cumulative Return During Crash'] = (1 + APTVdur['avgreturnduring']).cumprod()
#period after crash
APTVaft = web.DataReader('APTV', 'yahoo', crashend, end)
APTVaft['avgreturnafter'] = APTVaft['Close'].pct_change(1)
APTVaft['Cumulative Return After Crash'] = (1 + APTVaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AZO = web.DataReader('AZO', 'yahoo', start, end)
AZO['returns'] = AZO['Close'].pct_change(1)
AZO['Cumulative Return'] = (1 + AZO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AZOmean = AZO['returns'].mean()
AZOvar = AZO['returns'].var()
AZOkurt = AZO['returns'].kurt()
AZOskew = AZO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AZObef = web.DataReader('AZO', 'yahoo', start, crashstart)
AZObef['avgreturnbefore'] = AZObef['Close'].pct_change(1)
AZObef['Cumulative Return Before Crash'] = (1 + AZObef['avgreturnbefore']).cumprod()
#period of crash
AZOdur = web.DataReader('AZO', 'yahoo', crashstart, crashend)
AZOdur['avgreturnduring'] = AZOdur['Close'].pct_change(1)
AZOdur['Cumulative Return During Crash'] = (1 + AZOdur['avgreturnduring']).cumprod()
#period after crash
AZOaft = web.DataReader('AZO', 'yahoo', crashend, end)
AZOaft['avgreturnafter'] = AZOaft['Close'].pct_change(1)
AZOaft['Cumulative Return After Crash'] = (1 + AZOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BBY = web.DataReader('BBY', 'yahoo', start, end)
BBY['returns'] = BBY['Close'].pct_change(1)
BBY['Cumulative Return'] = (1 + BBY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BBYmean = BBY['returns'].mean()
BBYvar = BBY['returns'].var()
BBYkurt = BBY['returns'].kurt()
BBYskew = BBY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BBYbef = web.DataReader('BBY', 'yahoo', start, crashstart)
BBYbef['avgreturnbefore'] = BBYbef['Close'].pct_change(1)
BBYbef['Cumulative Return Before Crash'] = (1 + BBYbef['avgreturnbefore']).cumprod()
#period of crash
BBYdur = web.DataReader('BBY', 'yahoo', crashstart, crashend)
BBYdur['avgreturnduring'] = BBYdur['Close'].pct_change(1)
BBYdur['Cumulative Return During Crash'] = (1 + BBYdur['avgreturnduring']).cumprod()
#period after crash
BBYaft = web.DataReader('BBY', 'yahoo', crashend, end)
BBYaft['avgreturnafter'] = BBYaft['Close'].pct_change(1)
BBYaft['Cumulative Return After Crash'] = (1 + BBYaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BKNG = web.DataReader('BKNG', 'yahoo', start, end)
BKNG['returns'] = BKNG['Close'].pct_change(1)
BKNG['Cumulative Return'] = (1 + BKNG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BKNGmean = BKNG['returns'].mean()
BKNGvar = BKNG['returns'].var()
BKNGkurt = BKNG['returns'].kurt()
BKNGskew = BKNG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BKNGbef = web.DataReader('BKNG', 'yahoo', start, crashstart)
BKNGbef['avgreturnbefore'] = BKNGbef['Close'].pct_change(1)
BKNGbef['Cumulative Return Before Crash'] = (1 + BKNGbef['avgreturnbefore']).cumprod()
#period of crash
BKNGdur = web.DataReader('BKNG', 'yahoo', crashstart, crashend)
BKNGdur['avgreturnduring'] = BKNGdur['Close'].pct_change(1)
BKNGdur['Cumulative Return During Crash'] = (1 + BKNGdur['avgreturnduring']).cumprod()
#period after crash
BKNGaft = web.DataReader('BKNG', 'yahoo', crashend, end)
BKNGaft['avgreturnafter'] = BKNGaft['Close'].pct_change(1)
BKNGaft['Cumulative Return After Crash'] = (1 + BKNGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BWA = web.DataReader('BWA', 'yahoo', start, end)
BWA['returns'] = BWA['Close'].pct_change(1)
BWA['Cumulative Return'] = (1 + BWA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BWAmean = BWA['returns'].mean()
BWAvar = BWA['returns'].var()
BWAkurt = BWA['returns'].kurt()
BWAskew = BWA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BWAbef = web.DataReader('BWA', 'yahoo', start, crashstart)
BWAbef['avgreturnbefore'] = BWAbef['Close'].pct_change(1)
BWAbef['Cumulative Return Before Crash'] = (1 + BWAbef['avgreturnbefore']).cumprod()
#period of crash
BWAdur = web.DataReader('BWA', 'yahoo', crashstart, crashend)
BWAdur['avgreturnduring'] = BWAdur['Close'].pct_change(1)
BWAdur['Cumulative Return During Crash'] = (1 + BWAdur['avgreturnduring']).cumprod()
#period after crash
BWAaft = web.DataReader('BWA', 'yahoo', crashend, end)
BWAaft['avgreturnafter'] = BWAaft['Close'].pct_change(1)
BWAaft['Cumulative Return After Crash'] = (1 + BWAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
KMX = web.DataReader('KMX', 'yahoo', start, end)
KMX['returns'] = KMX['Close'].pct_change(1)
KMX['Cumulative Return'] = (1 + KMX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
KMXmean = KMX['returns'].mean()
KMXvar = KMX['returns'].var()
KMXkurt = KMX['returns'].kurt()
KMXskew = KMX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
KMXbef = web.DataReader('KMX', 'yahoo', start, crashstart)
KMXbef['avgreturnbefore'] = KMXbef['Close'].pct_change(1)
KMXbef['Cumulative Return Before Crash'] = (1 + KMXbef['avgreturnbefore']).cumprod()
#period of crash
KMXdur = web.DataReader('KMX', 'yahoo', crashstart, crashend)
KMXdur['avgreturnduring'] = KMXdur['Close'].pct_change(1)
KMXdur['Cumulative Return During Crash'] = (1 + KMXdur['avgreturnduring']).cumprod()
#period after crash
KMXaft = web.DataReader('KMX', 'yahoo', crashend, end)
KMXaft['avgreturnafter'] = KMXaft['Close'].pct_change(1)
KMXaft['Cumulative Return After Crash'] = (1 + KMXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CCL = web.DataReader('CCL', 'yahoo', start, end)
CCL['returns'] = CCL['Close'].pct_change(1)
CCL['Cumulative Return'] = (1 + CCL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CCLmean = CCL['returns'].mean()
CCLvar = CCL['returns'].var()
CCLkurt = CCL['returns'].kurt()
CCLskew = CCL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CCLbef = web.DataReader('CCL', 'yahoo', start, crashstart)
CCLbef['avgreturnbefore'] = CCLbef['Close'].pct_change(1)
CCLbef['Cumulative Return Before Crash'] = (1 + CCLbef['avgreturnbefore']).cumprod()
#period of crash
CCLdur = web.DataReader('CCL', 'yahoo', crashstart, crashend)
CCLdur['avgreturnduring'] = CCLdur['Close'].pct_change(1)
CCLdur['Cumulative Return During Crash'] = (1 + CCLdur['avgreturnduring']).cumprod()
#period after crash
CCLaft = web.DataReader('CCL', 'yahoo', crashend, end)
CCLaft['avgreturnafter'] = CCLaft['Close'].pct_change(1)
CCLaft['Cumulative Return After Crash'] = (1 + CCLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CMG = web.DataReader('CMG', 'yahoo', start, end)
CMG['returns'] = CMG['Close'].pct_change(1)
CMG['Cumulative Return'] = (1 + CMG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CMGmean = CMG['returns'].mean()
CMGvar = CMG['returns'].var()
CMGkurt = CMG['returns'].kurt()
CMGskew = CMG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CMGbef = web.DataReader('CMG', 'yahoo', start, crashstart)
CMGbef['avgreturnbefore'] = CMGbef['Close'].pct_change(1)
CMGbef['Cumulative Return Before Crash'] = (1 + CMGbef['avgreturnbefore']).cumprod()
#period of crash
CMGdur = web.DataReader('CMG', 'yahoo', crashstart, crashend)
CMGdur['avgreturnduring'] = CMGdur['Close'].pct_change(1)
CMGdur['Cumulative Return During Crash'] = (1 + CMGdur['avgreturnduring']).cumprod()
#period after crash
CMGaft = web.DataReader('CMG', 'yahoo', crashend, end)
CMGaft['avgreturnafter'] = CMGaft['Close'].pct_change(1)
CMGaft['Cumulative Return After Crash'] = (1 + CMGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DHI = web.DataReader('DHI', 'yahoo', start, end)
DHI['returns'] = DHI['Close'].pct_change(1)
DHI['Cumulative Return'] = (1 + DHI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DHImean = DHI['returns'].mean()
DHIvar = DHI['returns'].var()
DHIkurt = DHI['returns'].kurt()
DHIskew = DHI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DHIbef = web.DataReader('DHI', 'yahoo', start, crashstart)
DHIbef['avgreturnbefore'] = DHIbef['Close'].pct_change(1)
DHIbef['Cumulative Return Before Crash'] = (1 + DHIbef['avgreturnbefore']).cumprod()
#period of crash
DHIdur = web.DataReader('DHI', 'yahoo', crashstart, crashend)
DHIdur['avgreturnduring'] = DHIdur['Close'].pct_change(1)
DHIdur['Cumulative Return During Crash'] = (1 + DHIdur['avgreturnduring']).cumprod()
#period after crash
DHIaft = web.DataReader('DHI', 'yahoo', crashend, end)
DHIaft['avgreturnafter'] = DHIaft['Close'].pct_change(1)
DHIaft['Cumulative Return After Crash'] = (1 + DHIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DRI = web.DataReader('DRI', 'yahoo', start, end)
DRI['returns'] = DRI['Close'].pct_change(1)
DRI['Cumulative Return'] = (1 + DRI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DRImean = DRI['returns'].mean()
DRIvar = DRI['returns'].var()
DRIkurt = DRI['returns'].kurt()
DRIskew = DRI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DRIbef = web.DataReader('DRI', 'yahoo', start, crashstart)
DRIbef['avgreturnbefore'] = DRIbef['Close'].pct_change(1)
DRIbef['Cumulative Return Before Crash'] = (1 + DRIbef['avgreturnbefore']).cumprod()
#period of crash
DRIdur = web.DataReader('DRI', 'yahoo', crashstart, crashend)
DRIdur['avgreturnduring'] = DRIdur['Close'].pct_change(1)
DRIdur['Cumulative Return During Crash'] = (1 + DRIdur['avgreturnduring']).cumprod()
#period after crash
DRIaft = web.DataReader('DRI', 'yahoo', crashend, end)
DRIaft['avgreturnafter'] = DRIaft['Close'].pct_change(1)
DRIaft['Cumulative Return After Crash'] = (1 + DRIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DG = web.DataReader('DG', 'yahoo', start, end)
DG['returns'] = DG['Close'].pct_change(1)
DG['Cumulative Return'] = (1 + DG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DGmean = DG['returns'].mean()
DGvar = DG['returns'].var()
DGkurt = DG['returns'].kurt()
DGskew = DG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DGbef = web.DataReader('DG', 'yahoo', start, crashstart)
DGbef['avgreturnbefore'] = DGbef['Close'].pct_change(1)
DGbef['Cumulative Return Before Crash'] = (1 + DGbef['avgreturnbefore']).cumprod()
#period of crash
DGdur = web.DataReader('DG', 'yahoo', crashstart, crashend)
DGdur['avgreturnduring'] = DGdur['Close'].pct_change(1)
DGdur['Cumulative Return During Crash'] = (1 + DGdur['avgreturnduring']).cumprod()
#period after crash
DGaft = web.DataReader('DG', 'yahoo', crashend, end)
DGaft['avgreturnafter'] = DGaft['Close'].pct_change(1)
DGaft['Cumulative Return After Crash'] = (1 + DGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DLTR = web.DataReader('DLTR', 'yahoo', start, end)
DLTR['returns'] = DLTR['Close'].pct_change(1)
DLTR['Cumulative Return'] = (1 + DLTR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DLTRmean = DLTR['returns'].mean()
DLTRvar = DLTR['returns'].var()
DLTRkurt = DLTR['returns'].kurt()
DLTRskew = DLTR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DLTRbef = web.DataReader('DLTR', 'yahoo', start, crashstart)
DLTRbef['avgreturnbefore'] = DLTRbef['Close'].pct_change(1)
DLTRbef['Cumulative Return Before Crash'] = (1 + DLTRbef['avgreturnbefore']).cumprod()
#period of crash
DLTRdur = web.DataReader('DLTR', 'yahoo', crashstart, crashend)
DLTRdur['avgreturnduring'] = DLTRdur['Close'].pct_change(1)
DLTRdur['Cumulative Return During Crash'] = (1 + DLTRdur['avgreturnduring']).cumprod()
#period after crash
DLTRaft = web.DataReader('DLTR', 'yahoo', crashend, end)
DLTRaft['avgreturnafter'] = DLTRaft['Close'].pct_change(1)
DLTRaft['Cumulative Return After Crash'] = (1 + DLTRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DPZ = web.DataReader('DPZ', 'yahoo', start, end)
DPZ['returns'] = DPZ['Close'].pct_change(1)
DPZ['Cumulative Return'] = (1 + DPZ['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DPZmean = DPZ['returns'].mean()
DPZvar = DPZ['returns'].var()
DPZkurt = DPZ['returns'].kurt()
DPZskew = DPZ['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DPZbef = web.DataReader('DPZ', 'yahoo', start, crashstart)
DPZbef['avgreturnbefore'] = DPZbef['Close'].pct_change(1)
DPZbef['Cumulative Return Before Crash'] = (1 + DPZbef['avgreturnbefore']).cumprod()
#period of crash
DPZdur = web.DataReader('DPZ', 'yahoo', crashstart, crashend)
DPZdur['avgreturnduring'] = DPZdur['Close'].pct_change(1)
DPZdur['Cumulative Return During Crash'] = (1 + DPZdur['avgreturnduring']).cumprod()
#period after crash
DPZaft = web.DataReader('DPZ', 'yahoo', crashend, end)
DPZaft['avgreturnafter'] = DPZaft['Close'].pct_change(1)
DPZaft['Cumulative Return After Crash'] = (1 + DPZaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EBAY = web.DataReader('EBAY', 'yahoo', start, end)
EBAY['returns'] = EBAY['Close'].pct_change(1)
EBAY['Cumulative Return'] = (1 + EBAY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EBAYmean = EBAY['returns'].mean()
EBAYvar = EBAY['returns'].var()
EBAYkurt = EBAY['returns'].kurt()
EBAYskew = EBAY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EBAYbef = web.DataReader('EBAY', 'yahoo', start, crashstart)
EBAYbef['avgreturnbefore'] = EBAYbef['Close'].pct_change(1)
EBAYbef['Cumulative Return Before Crash'] = (1 + EBAYbef['avgreturnbefore']).cumprod()
#period of crash
EBAYdur = web.DataReader('EBAY', 'yahoo', crashstart, crashend)
EBAYdur['avgreturnduring'] = EBAYdur['Close'].pct_change(1)
EBAYdur['Cumulative Return During Crash'] = (1 + EBAYdur['avgreturnduring']).cumprod()
#period after crash
EBAYaft = web.DataReader('EBAY', 'yahoo', crashend, end)
EBAYaft['avgreturnafter'] = EBAYaft['Close'].pct_change(1)
EBAYaft['Cumulative Return After Crash'] = (1 + EBAYaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EXPE = web.DataReader('EXPE', 'yahoo', start, end)
EXPE['returns'] = EXPE['Close'].pct_change(1)
EXPE['Cumulative Return'] = (1 + EXPE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EXPEmean = EXPE['returns'].mean()
EXPEvar = EXPE['returns'].var()
EXPEkurt = EXPE['returns'].kurt()
EXPEskew = EXPE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EXPEbef = web.DataReader('EXPE', 'yahoo', start, crashstart)
EXPEbef['avgreturnbefore'] = EXPEbef['Close'].pct_change(1)
EXPEbef['Cumulative Return Before Crash'] = (1 + EXPEbef['avgreturnbefore']).cumprod()
#period of crash
EXPEdur = web.DataReader('EXPE', 'yahoo', crashstart, crashend)
EXPEdur['avgreturnduring'] = EXPEdur['Close'].pct_change(1)
EXPEdur['Cumulative Return During Crash'] = (1 + EXPEdur['avgreturnduring']).cumprod()
#period after crash
EXPEaft = web.DataReader('EXPE', 'yahoo', crashend, end)
EXPEaft['avgreturnafter'] = EXPEaft['Close'].pct_change(1)
EXPEaft['Cumulative Return After Crash'] = (1 + EXPEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
F = web.DataReader('F', 'yahoo', start, end)
F['returns'] = F['Close'].pct_change(1)
F['Cumulative Return'] = (1 + F['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
Fmean = F['returns'].mean()
Fvar = F['returns'].var()
Fkurt = F['returns'].kurt()
Fskew = F['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
Fbef = web.DataReader('F', 'yahoo', start, crashstart)
Fbef['avgreturnbefore'] = Fbef['Close'].pct_change(1)
Fbef['Cumulative Return Before Crash'] = (1 + Fbef['avgreturnbefore']).cumprod()
#period of crash
Fdur = web.DataReader('F', 'yahoo', crashstart, crashend)
Fdur['avgreturnduring'] = Fdur['Close'].pct_change(1)
Fdur['Cumulative Return During Crash'] = (1 + Fdur['avgreturnduring']).cumprod()
#period after crash
Faft = web.DataReader('F', 'yahoo', crashend, end)
Faft['avgreturnafter'] = Faft['Close'].pct_change(1)
Faft['Cumulative Return After Crash'] = (1 + Faft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GPS = web.DataReader('GPS', 'yahoo', start, end)
GPS['returns'] = GPS['Close'].pct_change(1)
GPS['Cumulative Return'] = (1 + GPS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GPSmean = GPS['returns'].mean()
GPSvar = GPS['returns'].var()
GPSkurt = GPS['returns'].kurt()
GPSskew = GPS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GPSbef = web.DataReader('GPS', 'yahoo', start, crashstart)
GPSbef['avgreturnbefore'] = GPSbef['Close'].pct_change(1)
GPSbef['Cumulative Return Before Crash'] = (1 + GPSbef['avgreturnbefore']).cumprod()
#period of crash
GPSdur = web.DataReader('GPS', 'yahoo', crashstart, crashend)
GPSdur['avgreturnduring'] = GPSdur['Close'].pct_change(1)
GPSdur['Cumulative Return During Crash'] = (1 + GPSdur['avgreturnduring']).cumprod()
#period after crash
GPSaft = web.DataReader('GPS', 'yahoo', crashend, end)
GPSaft['avgreturnafter'] = GPSaft['Close'].pct_change(1)
GPSaft['Cumulative Return After Crash'] = (1 + GPSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GRMN = web.DataReader('GRMN', 'yahoo', start, end)
GRMN['returns'] = GRMN['Close'].pct_change(1)
GRMN['Cumulative Return'] = (1 + GRMN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GRMNmean = GRMN['returns'].mean()
GRMNvar = GRMN['returns'].var()
GRMNkurt = GRMN['returns'].kurt()
GRMNskew = GRMN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GRMNbef = web.DataReader('GRMN', 'yahoo', start, crashstart)
GRMNbef['avgreturnbefore'] = GRMNbef['Close'].pct_change(1)
GRMNbef['Cumulative Return Before Crash'] = (1 + GRMNbef['avgreturnbefore']).cumprod()
#period of crash
GRMNdur = web.DataReader('GRMN', 'yahoo', crashstart, crashend)
GRMNdur['avgreturnduring'] = GRMNdur['Close'].pct_change(1)
GRMNdur['Cumulative Return During Crash'] = (1 + GRMNdur['avgreturnduring']).cumprod()
#period after crash
GRMNaft = web.DataReader('GRMN', 'yahoo', crashend, end)
GRMNaft['avgreturnafter'] = GRMNaft['Close'].pct_change(1)
GRMNaft['Cumulative Return After Crash'] = (1 + GRMNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GM = web.DataReader('GM', 'yahoo', start, end)
GM['returns'] = GM['Close'].pct_change(1)
GM['Cumulative Return'] = (1 + GM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GMmean = GM['returns'].mean()
GMvar = GM['returns'].var()
GMkurt = GM['returns'].kurt()
GMskew = GM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GMbef = web.DataReader('GM', 'yahoo', start, crashstart)
GMbef['avgreturnbefore'] = GMbef['Close'].pct_change(1)
GMbef['Cumulative Return Before Crash'] = (1 + GMbef['avgreturnbefore']).cumprod()
#period of crash
GMdur = web.DataReader('GM', 'yahoo', crashstart, crashend)
GMdur['avgreturnduring'] = GMdur['Close'].pct_change(1)
GMdur['Cumulative Return During Crash'] = (1 + GMdur['avgreturnduring']).cumprod()
#period after crash
GMaft = web.DataReader('GM', 'yahoo', crashend, end)
GMaft['avgreturnafter'] = GMaft['Close'].pct_change(1)
GMaft['Cumulative Return After Crash'] = (1 + GMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GPC = web.DataReader('GPC', 'yahoo', start, end)
GPC['returns'] = GPC['Close'].pct_change(1)
GPC['Cumulative Return'] = (1 + GPC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GPCmean = GPC['returns'].mean()
GPCvar = GPC['returns'].var()
GPCkurt = GPC['returns'].kurt()
GPCskew = GPC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GPCbef = web.DataReader('GPC', 'yahoo', start, crashstart)
GPCbef['avgreturnbefore'] = GPCbef['Close'].pct_change(1)
GPCbef['Cumulative Return Before Crash'] = (1 + GPCbef['avgreturnbefore']).cumprod()
#period of crash
GPCdur = web.DataReader('GPC', 'yahoo', crashstart, crashend)
GPCdur['avgreturnduring'] = GPCdur['Close'].pct_change(1)
GPCdur['Cumulative Return During Crash'] = (1 + GPCdur['avgreturnduring']).cumprod()
#period after crash
GPCaft = web.DataReader('GPC', 'yahoo', crashend, end)
GPCaft['avgreturnafter'] = GPCaft['Close'].pct_change(1)
GPCaft['Cumulative Return After Crash'] = (1 + GPCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HRB = web.DataReader('HRB', 'yahoo', start, end)
HRB['returns'] = HRB['Close'].pct_change(1)
HRB['Cumulative Return'] = (1 + HRB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HRBmean = HRB['returns'].mean()
HRBvar = HRB['returns'].var()
HRBkurt = HRB['returns'].kurt()
HRBskew = HRB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HRBbef = web.DataReader('HRB', 'yahoo', start, crashstart)
HRBbef['avgreturnbefore'] = HRBbef['Close'].pct_change(1)
HRBbef['Cumulative Return Before Crash'] = (1 + HRBbef['avgreturnbefore']).cumprod()
#period of crash
HRBdur = web.DataReader('HRB', 'yahoo', crashstart, crashend)
HRBdur['avgreturnduring'] = HRBdur['Close'].pct_change(1)
HRBdur['Cumulative Return During Crash'] = (1 + HRBdur['avgreturnduring']).cumprod()
#period after crash
HRBaft = web.DataReader('HRB', 'yahoo', crashend, end)
HRBaft['avgreturnafter'] = HRBaft['Close'].pct_change(1)
HRBaft['Cumulative Return After Crash'] = (1 + HRBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HBI = web.DataReader('HBI', 'yahoo', start, end)
HBI['returns'] = HBI['Close'].pct_change(1)
HBI['Cumulative Return'] = (1 + HBI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HBImean = HBI['returns'].mean()
HBIvar = HBI['returns'].var()
HBIkurt = HBI['returns'].kurt()
HBIskew = HBI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HBIbef = web.DataReader('HBI', 'yahoo', start, crashstart)
HBIbef['avgreturnbefore'] = HBIbef['Close'].pct_change(1)
HBIbef['Cumulative Return Before Crash'] = (1 + HBIbef['avgreturnbefore']).cumprod()
#period of crash
HBIdur = web.DataReader('HBI', 'yahoo', crashstart, crashend)
HBIdur['avgreturnduring'] = HBIdur['Close'].pct_change(1)
HBIdur['Cumulative Return During Crash'] = (1 + HBIdur['avgreturnduring']).cumprod()
#period after crash
HBIaft = web.DataReader('HBI', 'yahoo', crashend, end)
HBIaft['avgreturnafter'] = HBIaft['Close'].pct_change(1)
HBIaft['Cumulative Return After Crash'] = (1 + HBIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HOG = web.DataReader('HOG', 'yahoo', start, end)
HOG['returns'] = HOG['Close'].pct_change(1)
HOG['Cumulative Return'] = (1 + HOG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HOGmean = HOG['returns'].mean()
HOGvar = HOG['returns'].var()
HOGkurt = HOG['returns'].kurt()
HOGskew = HOG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HOGbef = web.DataReader('HOG', 'yahoo', start, crashstart)
HOGbef['avgreturnbefore'] = HOGbef['Close'].pct_change(1)
HOGbef['Cumulative Return Before Crash'] = (1 + HOGbef['avgreturnbefore']).cumprod()
#period of crash
HOGdur = web.DataReader('HOG', 'yahoo', crashstart, crashend)
HOGdur['avgreturnduring'] = HOGdur['Close'].pct_change(1)
HOGdur['Cumulative Return During Crash'] = (1 + HOGdur['avgreturnduring']).cumprod()
#period after crash
HOGaft = web.DataReader('HOG', 'yahoo', crashend, end)
HOGaft['avgreturnafter'] = HOGaft['Close'].pct_change(1)
HOGaft['Cumulative Return After Crash'] = (1 + HOGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HAS = web.DataReader('HAS', 'yahoo', start, end)
HAS['returns'] = HAS['Close'].pct_change(1)
HAS['Cumulative Return'] = (1 + HAS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HASmean = HAS['returns'].mean()
HASvar = HAS['returns'].var()
HASkurt = HAS['returns'].kurt()
HASskew = HAS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HASbef = web.DataReader('HAS', 'yahoo', start, crashstart)
HASbef['avgreturnbefore'] = HASbef['Close'].pct_change(1)
HASbef['Cumulative Return Before Crash'] = (1 + HASbef['avgreturnbefore']).cumprod()
#period of crash
HASdur = web.DataReader('HAS', 'yahoo', crashstart, crashend)
HASdur['avgreturnduring'] = HASdur['Close'].pct_change(1)
HASdur['Cumulative Return During Crash'] = (1 + HASdur['avgreturnduring']).cumprod()
#period after crash
HASaft = web.DataReader('HAS', 'yahoo', crashend, end)
HASaft['avgreturnafter'] = HASaft['Close'].pct_change(1)
HASaft['Cumulative Return After Crash'] = (1 + HASaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HLT = web.DataReader('HLT', 'yahoo', start, end)
HLT['returns'] = HLT['Close'].pct_change(1)
HLT['Cumulative Return'] = (1 + HLT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HLTmean = HLT['returns'].mean()
HLTvar = HLT['returns'].var()
HLTkurt = HLT['returns'].kurt()
HLTskew = HLT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HLTbef = web.DataReader('HLT', 'yahoo', start, crashstart)
HLTbef['avgreturnbefore'] = HLTbef['Close'].pct_change(1)
HLTbef['Cumulative Return Before Crash'] = (1 + HLTbef['avgreturnbefore']).cumprod()
#period of crash
HLTdur = web.DataReader('HLT', 'yahoo', crashstart, crashend)
HLTdur['avgreturnduring'] = HLTdur['Close'].pct_change(1)
HLTdur['Cumulative Return During Crash'] = (1 + HLTdur['avgreturnduring']).cumprod()
#period after crash
HLTaft = web.DataReader('HLT', 'yahoo', crashend, end)
HLTaft['avgreturnafter'] = HLTaft['Close'].pct_change(1)
HLTaft['Cumulative Return After Crash'] = (1 + HLTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HD = web.DataReader('HD', 'yahoo', start, end)
HD['returns'] = HD['Close'].pct_change(1)
HD['Cumulative Return'] = (1 + HD['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HDmean = HD['returns'].mean()
HDvar = HD['returns'].var()
HDkurt = HD['returns'].kurt()
HDskew = HD['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HDbef = web.DataReader('HD', 'yahoo', start, crashstart)
HDbef['avgreturnbefore'] = HDbef['Close'].pct_change(1)
HDbef['Cumulative Return Before Crash'] = (1 + HDbef['avgreturnbefore']).cumprod()
#period of crash
HDdur = web.DataReader('HD', 'yahoo', crashstart, crashend)
HDdur['avgreturnduring'] = HDdur['Close'].pct_change(1)
HDdur['Cumulative Return During Crash'] = (1 + HDdur['avgreturnduring']).cumprod()
#period after crash
HDaft = web.DataReader('HD', 'yahoo', crashend, end)
HDaft['avgreturnafter'] = HDaft['Close'].pct_change(1)
HDaft['Cumulative Return After Crash'] = (1 + HDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
KSS = web.DataReader('KSS', 'yahoo', start, end)
KSS['returns'] = KSS['Close'].pct_change(1)
KSS['Cumulative Return'] = (1 + KSS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
KSSmean = KSS['returns'].mean()
KSSvar = KSS['returns'].var()
KSSkurt = KSS['returns'].kurt()
KSSskew = KSS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
KSSbef = web.DataReader('KSS', 'yahoo', start, crashstart)
KSSbef['avgreturnbefore'] = KSSbef['Close'].pct_change(1)
KSSbef['Cumulative Return Before Crash'] = (1 + KSSbef['avgreturnbefore']).cumprod()
#period of crash
KSSdur = web.DataReader('KSS', 'yahoo', crashstart, crashend)
KSSdur['avgreturnduring'] = KSSdur['Close'].pct_change(1)
KSSdur['Cumulative Return During Crash'] = (1 + KSSdur['avgreturnduring']).cumprod()
#period after crash
KSSaft = web.DataReader('KSS', 'yahoo', crashend, end)
KSSaft['avgreturnafter'] = KSSaft['Close'].pct_change(1)
KSSaft['Cumulative Return After Crash'] = (1 + KSSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LB = web.DataReader('LB', 'yahoo', start, end)
LB['returns'] = LB['Close'].pct_change(1)
LB['Cumulative Return'] = (1 + LB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LBmean = LB['returns'].mean()
LBvar = LB['returns'].var()
LBkurt = LB['returns'].kurt()
LBskew = LB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LBbef = web.DataReader('LB', 'yahoo', start, crashstart)
LBbef['avgreturnbefore'] = LBbef['Close'].pct_change(1)
LBbef['Cumulative Return Before Crash'] = (1 + LBbef['avgreturnbefore']).cumprod()
#period of crash
LBdur = web.DataReader('LB', 'yahoo', crashstart, crashend)
LBdur['avgreturnduring'] = LBdur['Close'].pct_change(1)
LBdur['Cumulative Return During Crash'] = (1 + LBdur['avgreturnduring']).cumprod()
#period after crash
LBaft = web.DataReader('LB', 'yahoo', crashend, end)
LBaft['avgreturnafter'] = LBaft['Close'].pct_change(1)
LBaft['Cumulative Return After Crash'] = (1 + LBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LVS = web.DataReader('LVS', 'yahoo', start, end)
LVS['returns'] = LVS['Close'].pct_change(1)
LVS['Cumulative Return'] = (1 + LVS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LVSmean = LVS['returns'].mean()
LVSvar = LVS['returns'].var()
LVSkurt = LVS['returns'].kurt()
LVSskew = LVS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LVSbef = web.DataReader('LVS', 'yahoo', start, crashstart)
LVSbef['avgreturnbefore'] = LVSbef['Close'].pct_change(1)
LVSbef['Cumulative Return Before Crash'] = (1 + LVSbef['avgreturnbefore']).cumprod()
#period of crash
LVSdur = web.DataReader('LVS', 'yahoo', crashstart, crashend)
LVSdur['avgreturnduring'] = LVSdur['Close'].pct_change(1)
LVSdur['Cumulative Return During Crash'] = (1 + LVSdur['avgreturnduring']).cumprod()
#period after crash
LVSaft = web.DataReader('LVS', 'yahoo', crashend, end)
LVSaft['avgreturnafter'] = LVSaft['Close'].pct_change(1)
LVSaft['Cumulative Return After Crash'] = (1 + LVSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LEG = web.DataReader('LEG', 'yahoo', start, end)
LEG['returns'] = LEG['Close'].pct_change(1)
LEG['Cumulative Return'] = (1 + LEG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LEGmean = LEG['returns'].mean()
LEGvar = LEG['returns'].var()
LEGkurt = LEG['returns'].kurt()
LEGskew = LEG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LEGbef = web.DataReader('LEG', 'yahoo', start, crashstart)
LEGbef['avgreturnbefore'] = LEGbef['Close'].pct_change(1)
LEGbef['Cumulative Return Before Crash'] = (1 + LEGbef['avgreturnbefore']).cumprod()
#period of crash
LEGdur = web.DataReader('LEG', 'yahoo', crashstart, crashend)
LEGdur['avgreturnduring'] = LEGdur['Close'].pct_change(1)
LEGdur['Cumulative Return During Crash'] = (1 + LEGdur['avgreturnduring']).cumprod()
#period after crash
LEGaft = web.DataReader('LEG', 'yahoo', crashend, end)
LEGaft['avgreturnafter'] = LEGaft['Close'].pct_change(1)
LEGaft['Cumulative Return After Crash'] = (1 + LEGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LEN = web.DataReader('LEN', 'yahoo', start, end)
LEN['returns'] = LEN['Close'].pct_change(1)
LEN['Cumulative Return'] = (1 + LEN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LENmean = LEN['returns'].mean()
LENvar = LEN['returns'].var()
LENkurt = LEN['returns'].kurt()
LENskew = LEN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LENbef = web.DataReader('LEN', 'yahoo', start, crashstart)
LENbef['avgreturnbefore'] = LENbef['Close'].pct_change(1)
LENbef['Cumulative Return Before Crash'] = (1 + LENbef['avgreturnbefore']).cumprod()
#period of crash
LENdur = web.DataReader('LEN', 'yahoo', crashstart, crashend)
LENdur['avgreturnduring'] = LENdur['Close'].pct_change(1)
LENdur['Cumulative Return During Crash'] = (1 + LENdur['avgreturnduring']).cumprod()
#period after crash
LENaft = web.DataReader('LEN', 'yahoo', crashend, end)
LENaft['avgreturnafter'] = LENaft['Close'].pct_change(1)
LENaft['Cumulative Return After Crash'] = (1 + LENaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LKQ = web.DataReader('LKQ', 'yahoo', start, end)
LKQ['returns'] = LKQ['Close'].pct_change(1)
LKQ['Cumulative Return'] = (1 + LKQ['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LKQmean = LKQ['returns'].mean()
LKQvar = LKQ['returns'].var()
LKQkurt = LKQ['returns'].kurt()
LKQskew = LKQ['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LKQbef = web.DataReader('LKQ', 'yahoo', start, crashstart)
LKQbef['avgreturnbefore'] = LKQbef['Close'].pct_change(1)
LKQbef['Cumulative Return Before Crash'] = (1 + LKQbef['avgreturnbefore']).cumprod()
#period of crash
LKQdur = web.DataReader('LKQ', 'yahoo', crashstart, crashend)
LKQdur['avgreturnduring'] = LKQdur['Close'].pct_change(1)
LKQdur['Cumulative Return During Crash'] = (1 + LKQdur['avgreturnduring']).cumprod()
#period after crash
LKQaft = web.DataReader('LKQ', 'yahoo', crashend, end)
LKQaft['avgreturnafter'] = LKQaft['Close'].pct_change(1)
LKQaft['Cumulative Return After Crash'] = (1 + LKQaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LOW = web.DataReader('LOW', 'yahoo', start, end)
LOW['returns'] = LOW['Close'].pct_change(1)
LOW['Cumulative Return'] = (1 + LOW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LOWmean = LOW['returns'].mean()
LOWvar = LOW['returns'].var()
LOWkurt = LOW['returns'].kurt()
LOWskew = LOW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LOWbef = web.DataReader('LOW', 'yahoo', start, crashstart)
LOWbef['avgreturnbefore'] = LOWbef['Close'].pct_change(1)
LOWbef['Cumulative Return Before Crash'] = (1 + LOWbef['avgreturnbefore']).cumprod()
#period of crash
LOWdur = web.DataReader('LOW', 'yahoo', crashstart, crashend)
LOWdur['avgreturnduring'] = LOWdur['Close'].pct_change(1)
LOWdur['Cumulative Return During Crash'] = (1 + LOWdur['avgreturnduring']).cumprod()
#period after crash
LOWaft = web.DataReader('LOW', 'yahoo', crashend, end)
LOWaft['avgreturnafter'] = LOWaft['Close'].pct_change(1)
LOWaft['Cumulative Return After Crash'] = (1 + LOWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MAR = web.DataReader('MAR', 'yahoo', start, end)
MAR['returns'] = MAR['Close'].pct_change(1)
MAR['Cumulative Return'] = (1 + MAR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MARmean = MAR['returns'].mean()
MARvar = MAR['returns'].var()
MARkurt = MAR['returns'].kurt()
MARskew = MAR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MARbef = web.DataReader('MAR', 'yahoo', start, crashstart)
MARbef['avgreturnbefore'] = MARbef['Close'].pct_change(1)
MARbef['Cumulative Return Before Crash'] = (1 + MARbef['avgreturnbefore']).cumprod()
#period of crash
MARdur = web.DataReader('MAR', 'yahoo', crashstart, crashend)
MARdur['avgreturnduring'] = MARdur['Close'].pct_change(1)
MARdur['Cumulative Return During Crash'] = (1 + MARdur['avgreturnduring']).cumprod()
#period after crash
MARaft = web.DataReader('MAR', 'yahoo', crashend, end)
MARaft['avgreturnafter'] = MARaft['Close'].pct_change(1)
MARaft['Cumulative Return After Crash'] = (1 + MARaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MCD = web.DataReader('MCD', 'yahoo', start, end)
MCD['returns'] = MCD['Close'].pct_change(1)
MCD['Cumulative Return'] = (1 + MCD['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MCDmean = MCD['returns'].mean()
MCDvar = MCD['returns'].var()
MCDkurt = MCD['returns'].kurt()
MCDskew = MCD['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MCDbef = web.DataReader('MCD', 'yahoo', start, crashstart)
MCDbef['avgreturnbefore'] = MCDbef['Close'].pct_change(1)
MCDbef['Cumulative Return Before Crash'] = (1 + MCDbef['avgreturnbefore']).cumprod()
#period of crash
MCDdur = web.DataReader('MCD', 'yahoo', crashstart, crashend)
MCDdur['avgreturnduring'] = MCDdur['Close'].pct_change(1)
MCDdur['Cumulative Return During Crash'] = (1 + MCDdur['avgreturnduring']).cumprod()
#period after crash
MCDaft = web.DataReader('MCD', 'yahoo', crashend, end)
MCDaft['avgreturnafter'] = MCDaft['Close'].pct_change(1)
MCDaft['Cumulative Return After Crash'] = (1 + MCDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MGM = web.DataReader('MGM', 'yahoo', start, end)
MGM['returns'] = MGM['Close'].pct_change(1)
MGM['Cumulative Return'] = (1 + MGM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MGMmean = MGM['returns'].mean()
MGMvar = MGM['returns'].var()
MGMkurt = MGM['returns'].kurt()
MGMskew = MGM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MGMbef = web.DataReader('MGM', 'yahoo', start, crashstart)
MGMbef['avgreturnbefore'] = MGMbef['Close'].pct_change(1)
MGMbef['Cumulative Return Before Crash'] = (1 + MGMbef['avgreturnbefore']).cumprod()
#period of crash
MGMdur = web.DataReader('MGM', 'yahoo', crashstart, crashend)
MGMdur['avgreturnduring'] = MGMdur['Close'].pct_change(1)
MGMdur['Cumulative Return During Crash'] = (1 + MGMdur['avgreturnduring']).cumprod()
#period after crash
MGMaft = web.DataReader('MGM', 'yahoo', crashend, end)
MGMaft['avgreturnafter'] = MGMaft['Close'].pct_change(1)
MGMaft['Cumulative Return After Crash'] = (1 + MGMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MHK = web.DataReader('MHK', 'yahoo', start, end)
MHK['returns'] = MHK['Close'].pct_change(1)
MHK['Cumulative Return'] = (1 + MHK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MHKmean = MHK['returns'].mean()
MHKvar = MHK['returns'].var()
MHKkurt = MHK['returns'].kurt()
MHKskew = MHK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MHKbef = web.DataReader('MHK', 'yahoo', start, crashstart)
MHKbef['avgreturnbefore'] = MHKbef['Close'].pct_change(1)
MHKbef['Cumulative Return Before Crash'] = (1 + MHKbef['avgreturnbefore']).cumprod()
#period of crash
MHKdur = web.DataReader('MHK', 'yahoo', crashstart, crashend)
MHKdur['avgreturnduring'] = MHKdur['Close'].pct_change(1)
MHKdur['Cumulative Return During Crash'] = (1 + MHKdur['avgreturnduring']).cumprod()
#period after crash
MHKaft = web.DataReader('MHK', 'yahoo', crashend, end)
MHKaft['avgreturnafter'] = MHKaft['Close'].pct_change(1)
MHKaft['Cumulative Return After Crash'] = (1 + MHKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NWL = web.DataReader('NWL', 'yahoo', start, end)
NWL['returns'] = NWL['Close'].pct_change(1)
NWL['Cumulative Return'] = (1 + NWL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NWLmean = NWL['returns'].mean()
NWLvar = NWL['returns'].var()
NWLkurt = NWL['returns'].kurt()
NWLskew = NWL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NWLbef = web.DataReader('NWL', 'yahoo', start, crashstart)
NWLbef['avgreturnbefore'] = NWLbef['Close'].pct_change(1)
NWLbef['Cumulative Return Before Crash'] = (1 + NWLbef['avgreturnbefore']).cumprod()
#period of crash
NWLdur = web.DataReader('NWL', 'yahoo', crashstart, crashend)
NWLdur['avgreturnduring'] = NWLdur['Close'].pct_change(1)
NWLdur['Cumulative Return During Crash'] = (1 + NWLdur['avgreturnduring']).cumprod()
#period after crash
NWLaft = web.DataReader('NWL', 'yahoo', crashend, end)
NWLaft['avgreturnafter'] = NWLaft['Close'].pct_change(1)
NWLaft['Cumulative Return After Crash'] = (1 + NWLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NKE = web.DataReader('NKE', 'yahoo', start, end)
NKE['returns'] = NKE['Close'].pct_change(1)
NKE['Cumulative Return'] = (1 + NKE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NKEmean = NKE['returns'].mean()
NKEvar = NKE['returns'].var()
NKEkurt = NKE['returns'].kurt()
NKEskew = NKE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NKEbef = web.DataReader('NKE', 'yahoo', start, crashstart)
NKEbef['avgreturnbefore'] = NKEbef['Close'].pct_change(1)
NKEbef['Cumulative Return Before Crash'] = (1 + NKEbef['avgreturnbefore']).cumprod()
#period of crash
NKEdur = web.DataReader('NKE', 'yahoo', crashstart, crashend)
NKEdur['avgreturnduring'] = NKEdur['Close'].pct_change(1)
NKEdur['Cumulative Return During Crash'] = (1 + NKEdur['avgreturnduring']).cumprod()
#period after crash
NKEaft = web.DataReader('NKE', 'yahoo', crashend, end)
NKEaft['avgreturnafter'] = NKEaft['Close'].pct_change(1)
NKEaft['Cumulative Return After Crash'] = (1 + NKEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
JWN = web.DataReader('JWN', 'yahoo', start, end)
JWN['returns'] = JWN['Close'].pct_change(1)
JWN['Cumulative Return'] = (1 + JWN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
JWNmean = JWN['returns'].mean()
JWNvar = JWN['returns'].var()
JWNkurt = JWN['returns'].kurt()
JWNskew = JWN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
JWNbef = web.DataReader('JWN', 'yahoo', start, crashstart)
JWNbef['avgreturnbefore'] = JWNbef['Close'].pct_change(1)
JWNbef['Cumulative Return Before Crash'] = (1 + JWNbef['avgreturnbefore']).cumprod()
#period of crash
JWNdur = web.DataReader('JWN', 'yahoo', crashstart, crashend)
JWNdur['avgreturnduring'] = JWNdur['Close'].pct_change(1)
JWNdur['Cumulative Return During Crash'] = (1 + JWNdur['avgreturnduring']).cumprod()
#period after crash
JWNaft = web.DataReader('JWN', 'yahoo', crashend, end)
JWNaft['avgreturnafter'] = JWNaft['Close'].pct_change(1)
JWNaft['Cumulative Return After Crash'] = (1 + JWNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NCLH = web.DataReader('NCLH', 'yahoo', start, end)
NCLH['returns'] = NCLH['Close'].pct_change(1)
NCLH['Cumulative Return'] = (1 + NCLH['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NCLHmean = NCLH['returns'].mean()
NCLHvar = NCLH['returns'].var()
NCLHkurt = NCLH['returns'].kurt()
NCLHskew = NCLH['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NCLHbef = web.DataReader('NCLH', 'yahoo', start, crashstart)
NCLHbef['avgreturnbefore'] = NCLHbef['Close'].pct_change(1)
NCLHbef['Cumulative Return Before Crash'] = (1 + NCLHbef['avgreturnbefore']).cumprod()
#period of crash
NCLHdur = web.DataReader('NCLH', 'yahoo', crashstart, crashend)
NCLHdur['avgreturnduring'] = NCLHdur['Close'].pct_change(1)
NCLHdur['Cumulative Return During Crash'] = (1 + NCLHdur['avgreturnduring']).cumprod()
#period after crash
NCLHaft = web.DataReader('NCLH', 'yahoo', crashend, end)
NCLHaft['avgreturnafter'] = NCLHaft['Close'].pct_change(1)
NCLHaft['Cumulative Return After Crash'] = (1 + NCLHaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NVR = web.DataReader('NVR', 'yahoo', start, end)
NVR['returns'] = NVR['Close'].pct_change(1)
NVR['Cumulative Return'] = (1 + NVR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NVRmean = NVR['returns'].mean()
NVRvar = NVR['returns'].var()
NVRkurt = NVR['returns'].kurt()
NVRskew = NVR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NVRbef = web.DataReader('NVR', 'yahoo', start, crashstart)
NVRbef['avgreturnbefore'] = NVRbef['Close'].pct_change(1)
NVRbef['Cumulative Return Before Crash'] = (1 + NVRbef['avgreturnbefore']).cumprod()
#period of crash
NVRdur = web.DataReader('NVR', 'yahoo', crashstart, crashend)
NVRdur['avgreturnduring'] = NVRdur['Close'].pct_change(1)
NVRdur['Cumulative Return During Crash'] = (1 + NVRdur['avgreturnduring']).cumprod()
#period after crash
NVRaft = web.DataReader('NVR', 'yahoo', crashend, end)
NVRaft['avgreturnafter'] = NVRaft['Close'].pct_change(1)
NVRaft['Cumulative Return After Crash'] = (1 + NVRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ORLY = web.DataReader('ORLY', 'yahoo', start, end)
ORLY['returns'] = ORLY['Close'].pct_change(1)
ORLY['Cumulative Return'] = (1 + ORLY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ORLYmean = ORLY['returns'].mean()
ORLYvar = ORLY['returns'].var()
ORLYkurt = ORLY['returns'].kurt()
ORLYskew = ORLY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ORLYbef = web.DataReader('ORLY', 'yahoo', start, crashstart)
ORLYbef['avgreturnbefore'] = ORLYbef['Close'].pct_change(1)
ORLYbef['Cumulative Return Before Crash'] = (1 + ORLYbef['avgreturnbefore']).cumprod()
#period of crash
ORLYdur = web.DataReader('ORLY', 'yahoo', crashstart, crashend)
ORLYdur['avgreturnduring'] = ORLYdur['Close'].pct_change(1)
ORLYdur['Cumulative Return During Crash'] = (1 + ORLYdur['avgreturnduring']).cumprod()
#period after crash
ORLYaft = web.DataReader('ORLY', 'yahoo', crashend, end)
ORLYaft['avgreturnafter'] = ORLYaft['Close'].pct_change(1)
ORLYaft['Cumulative Return After Crash'] = (1 + ORLYaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PHM = web.DataReader('PHM', 'yahoo', start, end)
PHM['returns'] = PHM['Close'].pct_change(1)
PHM['Cumulative Return'] = (1 + PHM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PHMmean = PHM['returns'].mean()
PHMvar = PHM['returns'].var()
PHMkurt = PHM['returns'].kurt()
PHMskew = PHM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PHMbef = web.DataReader('PHM', 'yahoo', start, crashstart)
PHMbef['avgreturnbefore'] = PHMbef['Close'].pct_change(1)
PHMbef['Cumulative Return Before Crash'] = (1 + PHMbef['avgreturnbefore']).cumprod()
#period of crash
PHMdur = web.DataReader('PHM', 'yahoo', crashstart, crashend)
PHMdur['avgreturnduring'] = PHMdur['Close'].pct_change(1)
PHMdur['Cumulative Return During Crash'] = (1 + PHMdur['avgreturnduring']).cumprod()
#period after crash
PHMaft = web.DataReader('PHM', 'yahoo', crashend, end)
PHMaft['avgreturnafter'] = PHMaft['Close'].pct_change(1)
PHMaft['Cumulative Return After Crash'] = (1 + PHMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PVH = web.DataReader('PVH', 'yahoo', start, end)
PVH['returns'] = PVH['Close'].pct_change(1)
PVH['Cumulative Return'] = (1 + PVH['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PVHmean = PVH['returns'].mean()
PVHvar = PVH['returns'].var()
PVHkurt = PVH['returns'].kurt()
PVHskew = PVH['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PVHbef = web.DataReader('PVH', 'yahoo', start, crashstart)
PVHbef['avgreturnbefore'] = PVHbef['Close'].pct_change(1)
PVHbef['Cumulative Return Before Crash'] = (1 + PVHbef['avgreturnbefore']).cumprod()
#period of crash
PVHdur = web.DataReader('PVH', 'yahoo', crashstart, crashend)
PVHdur['avgreturnduring'] = PVHdur['Close'].pct_change(1)
PVHdur['Cumulative Return During Crash'] = (1 + PVHdur['avgreturnduring']).cumprod()
#period after crash
PVHaft = web.DataReader('PVH', 'yahoo', crashend, end)
PVHaft['avgreturnafter'] = PVHaft['Close'].pct_change(1)
PVHaft['Cumulative Return After Crash'] = (1 + PVHaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
RL = web.DataReader('RL', 'yahoo', start, end)
RL['returns'] = RL['Close'].pct_change(1)
RL['Cumulative Return'] = (1 + RL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
RLmean = RL['returns'].mean()
RLvar = RL['returns'].var()
RLkurt = RL['returns'].kurt()
RLskew = RL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
RLbef = web.DataReader('RL', 'yahoo', start, crashstart)
RLbef['avgreturnbefore'] = RLbef['Close'].pct_change(1)
RLbef['Cumulative Return Before Crash'] = (1 + RLbef['avgreturnbefore']).cumprod()
#period of crash
RLdur = web.DataReader('RL', 'yahoo', crashstart, crashend)
RLdur['avgreturnduring'] = RLdur['Close'].pct_change(1)
RLdur['Cumulative Return During Crash'] = (1 + RLdur['avgreturnduring']).cumprod()
#period after crash
RLaft = web.DataReader('RL', 'yahoo', crashend, end)
RLaft['avgreturnafter'] = RLaft['Close'].pct_change(1)
RLaft['Cumulative Return After Crash'] = (1 + RLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ROST = web.DataReader('ROST', 'yahoo', start, end)
ROST['returns'] = ROST['Close'].pct_change(1)
ROST['Cumulative Return'] = (1 + ROST['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ROSTmean = ROST['returns'].mean()
ROSTvar = ROST['returns'].var()
ROSTkurt = ROST['returns'].kurt()
ROSTskew = ROST['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ROSTbef = web.DataReader('ROST', 'yahoo', start, crashstart)
ROSTbef['avgreturnbefore'] = ROSTbef['Close'].pct_change(1)
ROSTbef['Cumulative Return Before Crash'] = (1 + ROSTbef['avgreturnbefore']).cumprod()
#period of crash
ROSTdur = web.DataReader('ROST', 'yahoo', crashstart, crashend)
ROSTdur['avgreturnduring'] = ROSTdur['Close'].pct_change(1)
ROSTdur['Cumulative Return During Crash'] = (1 + ROSTdur['avgreturnduring']).cumprod()
#period after crash
ROSTaft = web.DataReader('ROST', 'yahoo', crashend, end)
ROSTaft['avgreturnafter'] = ROSTaft['Close'].pct_change(1)
ROSTaft['Cumulative Return After Crash'] = (1 + ROSTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
RCL = web.DataReader('RCL', 'yahoo', start, end)
RCL['returns'] = RCL['Close'].pct_change(1)
RCL['Cumulative Return'] = (1 + RCL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
RCLmean = RCL['returns'].mean()
RCLvar = RCL['returns'].var()
RCLkurt = RCL['returns'].kurt()
RCLskew = RCL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
RCLbef = web.DataReader('RCL', 'yahoo', start, crashstart)
RCLbef['avgreturnbefore'] = RCLbef['Close'].pct_change(1)
RCLbef['Cumulative Return Before Crash'] = (1 + RCLbef['avgreturnbefore']).cumprod()
#period of crash
RCLdur = web.DataReader('RCL', 'yahoo', crashstart, crashend)
RCLdur['avgreturnduring'] = RCLdur['Close'].pct_change(1)
RCLdur['Cumulative Return During Crash'] = (1 + RCLdur['avgreturnduring']).cumprod()
#period after crash
RCLaft = web.DataReader('RCL', 'yahoo', crashend, end)
RCLaft['avgreturnafter'] = RCLaft['Close'].pct_change(1)
RCLaft['Cumulative Return After Crash'] = (1 + RCLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SBUX = web.DataReader('SBUX', 'yahoo', start, end)
SBUX['returns'] = SBUX['Close'].pct_change(1)
SBUX['Cumulative Return'] = (1 + SBUX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SBUXmean = SBUX['returns'].mean()
SBUXvar = SBUX['returns'].var()
SBUXkurt = SBUX['returns'].kurt()
SBUXskew = SBUX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SBUXbef = web.DataReader('SBUX', 'yahoo', start, crashstart)
SBUXbef['avgreturnbefore'] = SBUXbef['Close'].pct_change(1)
SBUXbef['Cumulative Return Before Crash'] = (1 + SBUXbef['avgreturnbefore']).cumprod()
#period of crash
SBUXdur = web.DataReader('SBUX', 'yahoo', crashstart, crashend)
SBUXdur['avgreturnduring'] = SBUXdur['Close'].pct_change(1)
SBUXdur['Cumulative Return During Crash'] = (1 + SBUXdur['avgreturnduring']).cumprod()
#period after crash
SBUXaft = web.DataReader('SBUX', 'yahoo', crashend, end)
SBUXaft['avgreturnafter'] = SBUXaft['Close'].pct_change(1)
SBUXaft['Cumulative Return After Crash'] = (1 + SBUXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TPR = web.DataReader('TPR', 'yahoo', start, end)
TPR['returns'] = TPR['Close'].pct_change(1)
TPR['Cumulative Return'] = (1 + TPR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TPRmean = TPR['returns'].mean()
TPRvar = TPR['returns'].var()
TPRkurt = TPR['returns'].kurt()
TPRskew = TPR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TPRbef = web.DataReader('TPR', 'yahoo', start, crashstart)
TPRbef['avgreturnbefore'] = TPRbef['Close'].pct_change(1)
TPRbef['Cumulative Return Before Crash'] = (1 + TPRbef['avgreturnbefore']).cumprod()
#period of crash
TPRdur = web.DataReader('TPR', 'yahoo', crashstart, crashend)
TPRdur['avgreturnduring'] = TPRdur['Close'].pct_change(1)
TPRdur['Cumulative Return During Crash'] = (1 + TPRdur['avgreturnduring']).cumprod()
#period after crash
TPRaft = web.DataReader('TPR', 'yahoo', crashend, end)
TPRaft['avgreturnafter'] = TPRaft['Close'].pct_change(1)
TPRaft['Cumulative Return After Crash'] = (1 + TPRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TGT = web.DataReader('TGT', 'yahoo', start, end)
TGT['returns'] = TGT['Close'].pct_change(1)
TGT['Cumulative Return'] = (1 + TGT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TGTmean = TGT['returns'].mean()
TGTvar = TGT['returns'].var()
TGTkurt = TGT['returns'].kurt()
TGTskew = TGT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TGTbef = web.DataReader('TGT', 'yahoo', start, crashstart)
TGTbef['avgreturnbefore'] = TGTbef['Close'].pct_change(1)
TGTbef['Cumulative Return Before Crash'] = (1 + TGTbef['avgreturnbefore']).cumprod()
#period of crash
TGTdur = web.DataReader('TGT', 'yahoo', crashstart, crashend)
TGTdur['avgreturnduring'] = TGTdur['Close'].pct_change(1)
TGTdur['Cumulative Return During Crash'] = (1 + TGTdur['avgreturnduring']).cumprod()
#period after crash
TGTaft = web.DataReader('TGT', 'yahoo', crashend, end)
TGTaft['avgreturnafter'] = TGTaft['Close'].pct_change(1)
TGTaft['Cumulative Return After Crash'] = (1 + TGTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TIF = web.DataReader('TIF', 'yahoo', start, end)
TIF['returns'] = TIF['Close'].pct_change(1)
TIF['Cumulative Return'] = (1 + TIF['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TIFmean = TIF['returns'].mean()
TIFvar = TIF['returns'].var()
TIFkurt = TIF['returns'].kurt()
TIFskew = TIF['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TIFbef = web.DataReader('TIF', 'yahoo', start, crashstart)
TIFbef['avgreturnbefore'] = TIFbef['Close'].pct_change(1)
TIFbef['Cumulative Return Before Crash'] = (1 + TIFbef['avgreturnbefore']).cumprod()
#period of crash
TIFdur = web.DataReader('TIF', 'yahoo', crashstart, crashend)
TIFdur['avgreturnduring'] = TIFdur['Close'].pct_change(1)
TIFdur['Cumulative Return During Crash'] = (1 + TIFdur['avgreturnduring']).cumprod()
#period after crash
TIFaft = web.DataReader('TIF', 'yahoo', crashend, end)
TIFaft['avgreturnafter'] = TIFaft['Close'].pct_change(1)
TIFaft['Cumulative Return After Crash'] = (1 + TIFaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TJX = web.DataReader('TJX', 'yahoo', start, end)
TJX['returns'] = TJX['Close'].pct_change(1)
TJX['Cumulative Return'] = (1 + TJX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TJXmean = TJX['returns'].mean()
TJXvar = TJX['returns'].var()
TJXkurt = TJX['returns'].kurt()
TJXskew = TJX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TJXbef = web.DataReader('TJX', 'yahoo', start, crashstart)
TJXbef['avgreturnbefore'] = TJXbef['Close'].pct_change(1)
TJXbef['Cumulative Return Before Crash'] = (1 + TJXbef['avgreturnbefore']).cumprod()
#period of crash
TJXdur = web.DataReader('TJX', 'yahoo', crashstart, crashend)
TJXdur['avgreturnduring'] = TJXdur['Close'].pct_change(1)
TJXdur['Cumulative Return During Crash'] = (1 + TJXdur['avgreturnduring']).cumprod()
#period after crash
TJXaft = web.DataReader('TJX', 'yahoo', crashend, end)
TJXaft['avgreturnafter'] = TJXaft['Close'].pct_change(1)
TJXaft['Cumulative Return After Crash'] = (1 + TJXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TSCO = web.DataReader('TSCO', 'yahoo', start, end)
TSCO['returns'] = TSCO['Close'].pct_change(1)
TSCO['Cumulative Return'] = (1 + TSCO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TSCOmean = TSCO['returns'].mean()
TSCOvar = TSCO['returns'].var()
TSCOkurt = TSCO['returns'].kurt()
TSCOskew = TSCO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TSCObef = web.DataReader('TSCO', 'yahoo', start, crashstart)
TSCObef['avgreturnbefore'] = TSCObef['Close'].pct_change(1)
TSCObef['Cumulative Return Before Crash'] = (1 + TSCObef['avgreturnbefore']).cumprod()
#period of crash
TSCOdur = web.DataReader('TSCO', 'yahoo', crashstart, crashend)
TSCOdur['avgreturnduring'] = TSCOdur['Close'].pct_change(1)
TSCOdur['Cumulative Return During Crash'] = (1 + TSCOdur['avgreturnduring']).cumprod()
#period after crash
TSCOaft = web.DataReader('TSCO', 'yahoo', crashend, end)
TSCOaft['avgreturnafter'] = TSCOaft['Close'].pct_change(1)
TSCOaft['Cumulative Return After Crash'] = (1 + TSCOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ULTA = web.DataReader('ULTA', 'yahoo', start, end)
ULTA['returns'] = ULTA['Close'].pct_change(1)
ULTA['Cumulative Return'] = (1 + ULTA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ULTAmean = ULTA['returns'].mean()
ULTAvar = ULTA['returns'].var()
ULTAkurt = ULTA['returns'].kurt()
ULTAskew = ULTA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ULTAbef = web.DataReader('ULTA', 'yahoo', start, crashstart)
ULTAbef['avgreturnbefore'] = ULTAbef['Close'].pct_change(1)
ULTAbef['Cumulative Return Before Crash'] = (1 + ULTAbef['avgreturnbefore']).cumprod()
#period of crash
ULTAdur = web.DataReader('ULTA', 'yahoo', crashstart, crashend)
ULTAdur['avgreturnduring'] = ULTAdur['Close'].pct_change(1)
ULTAdur['Cumulative Return During Crash'] = (1 + ULTAdur['avgreturnduring']).cumprod()
#period after crash
ULTAaft = web.DataReader('ULTA', 'yahoo', crashend, end)
ULTAaft['avgreturnafter'] = ULTAaft['Close'].pct_change(1)
ULTAaft['Cumulative Return After Crash'] = (1 + ULTAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
UAA = web.DataReader('UAA', 'yahoo', start, end)
UAA['returns'] = UAA['Close'].pct_change(1)
UAA['Cumulative Return'] = (1 + UAA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
UAAmean = UAA['returns'].mean()
UAAvar = UAA['returns'].var()
UAAkurt = UAA['returns'].kurt()
UAAskew = UAA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
UAAbef = web.DataReader('UAA', 'yahoo', start, crashstart)
UAAbef['avgreturnbefore'] = UAAbef['Close'].pct_change(1)
UAAbef['Cumulative Return Before Crash'] = (1 + UAAbef['avgreturnbefore']).cumprod()
#period of crash
UAAdur = web.DataReader('UAA', 'yahoo', crashstart, crashend)
UAAdur['avgreturnduring'] = UAAdur['Close'].pct_change(1)
UAAdur['Cumulative Return During Crash'] = (1 + UAAdur['avgreturnduring']).cumprod()
#period after crash
UAAaft = web.DataReader('UAA', 'yahoo', crashend, end)
UAAaft['avgreturnafter'] = UAAaft['Close'].pct_change(1)
UAAaft['Cumulative Return After Crash'] = (1 + UAAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
UA = web.DataReader('UA', 'yahoo', start, end)
UA['returns'] = UA['Close'].pct_change(1)
UA['Cumulative Return'] = (1 + UA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
UAmean = UA['returns'].mean()
UAvar = UA['returns'].var()
UAkurt = UA['returns'].kurt()
UAskew = UA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
UAbef = web.DataReader('UA', 'yahoo', start, crashstart)
UAbef['avgreturnbefore'] = UAbef['Close'].pct_change(1)
UAbef['Cumulative Return Before Crash'] = (1 + UAbef['avgreturnbefore']).cumprod()
#period of crash
UAdur = web.DataReader('UA', 'yahoo', crashstart, crashend)
UAdur['avgreturnduring'] = UAdur['Close'].pct_change(1)
UAdur['Cumulative Return During Crash'] = (1 + UAdur['avgreturnduring']).cumprod()
#period after crash
UAaft = web.DataReader('UA', 'yahoo', crashend, end)
UAaft['avgreturnafter'] = UAaft['Close'].pct_change(1)
UAaft['Cumulative Return After Crash'] = (1 + UAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
VFC = web.DataReader('VFC', 'yahoo', start, end)
VFC['returns'] = VFC['Close'].pct_change(1)
VFC['Cumulative Return'] = (1 + VFC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
VFCmean = VFC['returns'].mean()
VFCvar = VFC['returns'].var()
VFCkurt = VFC['returns'].kurt()
VFCskew = VFC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
VFCbef = web.DataReader('VFC', 'yahoo', start, crashstart)
VFCbef['avgreturnbefore'] = VFCbef['Close'].pct_change(1)
VFCbef['Cumulative Return Before Crash'] = (1 + VFCbef['avgreturnbefore']).cumprod()
#period of crash
VFCdur = web.DataReader('VFC', 'yahoo', crashstart, crashend)
VFCdur['avgreturnduring'] = VFCdur['Close'].pct_change(1)
VFCdur['Cumulative Return During Crash'] = (1 + VFCdur['avgreturnduring']).cumprod()
#period after crash
VFCaft = web.DataReader('VFC', 'yahoo', crashend, end)
VFCaft['avgreturnafter'] = VFCaft['Close'].pct_change(1)
VFCaft['Cumulative Return After Crash'] = (1 + VFCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WHR = web.DataReader('WHR', 'yahoo', start, end)
WHR['returns'] = WHR['Close'].pct_change(1)
WHR['Cumulative Return'] = (1 + WHR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WHRmean = WHR['returns'].mean()
WHRvar = WHR['returns'].var()
WHRkurt = WHR['returns'].kurt()
WHRskew = WHR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WHRbef = web.DataReader('WHR', 'yahoo', start, crashstart)
WHRbef['avgreturnbefore'] = WHRbef['Close'].pct_change(1)
WHRbef['Cumulative Return Before Crash'] = (1 + WHRbef['avgreturnbefore']).cumprod()
#period of crash
WHRdur = web.DataReader('WHR', 'yahoo', crashstart, crashend)
WHRdur['avgreturnduring'] = WHRdur['Close'].pct_change(1)
WHRdur['Cumulative Return During Crash'] = (1 + WHRdur['avgreturnduring']).cumprod()
#period after crash
WHRaft = web.DataReader('WHR', 'yahoo', crashend, end)
WHRaft['avgreturnafter'] = WHRaft['Close'].pct_change(1)
WHRaft['Cumulative Return After Crash'] = (1 + WHRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WYNN = web.DataReader('WYNN', 'yahoo', start, end)
WYNN['returns'] = WYNN['Close'].pct_change(1)
WYNN['Cumulative Return'] = (1 + WYNN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WYNNmean = WYNN['returns'].mean()
WYNNvar = WYNN['returns'].var()
WYNNkurt = WYNN['returns'].kurt()
WYNNskew = WYNN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WYNNbef = web.DataReader('WYNN', 'yahoo', start, crashstart)
WYNNbef['avgreturnbefore'] = WYNNbef['Close'].pct_change(1)
WYNNbef['Cumulative Return Before Crash'] = (1 + WYNNbef['avgreturnbefore']).cumprod()
#period of crash
WYNNdur = web.DataReader('WYNN', 'yahoo', crashstart, crashend)
WYNNdur['avgreturnduring'] = WYNNdur['Close'].pct_change(1)
WYNNdur['Cumulative Return During Crash'] = (1 + WYNNdur['avgreturnduring']).cumprod()
#period after crash
WYNNaft = web.DataReader('WYNN', 'yahoo', crashend, end)
WYNNaft['avgreturnafter'] = WYNNaft['Close'].pct_change(1)
WYNNaft['Cumulative Return After Crash'] = (1 + WYNNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
YUM = web.DataReader('YUM', 'yahoo', start, end)
YUM['returns'] = YUM['Close'].pct_change(1)
YUM['Cumulative Return'] = (1 + YUM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
YUMmean = YUM['returns'].mean()
YUMvar = YUM['returns'].var()
YUMkurt = YUM['returns'].kurt()
YUMskew = YUM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
YUMbef = web.DataReader('YUM', 'yahoo', start, crashstart)
YUMbef['avgreturnbefore'] = YUMbef['Close'].pct_change(1)
YUMbef['Cumulative Return Before Crash'] = (1 + YUMbef['avgreturnbefore']).cumprod()
#period of crash
YUMdur = web.DataReader('YUM', 'yahoo', crashstart, crashend)
YUMdur['avgreturnduring'] = YUMdur['Close'].pct_change(1)
YUMdur['Cumulative Return During Crash'] = (1 + YUMdur['avgreturnduring']).cumprod()
#period after crash
YUMaft = web.DataReader('YUM', 'yahoo', crashend, end)
YUMaft['avgreturnafter'] = YUMaft['Close'].pct_change(1)
YUMaft['Cumulative Return After Crash'] = (1 + YUMaft['avgreturnafter']).cumprod()
#KDE Plot for Consumer Discretionary Sector
sp['returns'].plot(kind = 'kde', label ='S&P 500', alpha=0.5)
AAP['returns'].plot(kind = 'kde', label ='AAP', figsize = (10,8), alpha=0.5, title = 'KDE of Consumer Discretionary Stocks')
AMZN['returns'].plot(kind = 'kde', label ='AMZN', alpha=0.5)
APTV['returns'].plot(kind = 'kde', label ='APTV', alpha=0.5)
AZO['returns'].plot(kind = 'kde', label ='AZO', alpha=0.5)
BBY['returns'].plot(kind = 'kde', label ='BBY', alpha=0.5)
BKNG['returns'].plot(kind = 'kde', label ='BKNG', alpha=0.5)
BWA['returns'].plot(kind = 'kde', label ='BWA', alpha=0.5)
KMX['returns'].plot(kind = 'kde', label ='KMX', alpha=0.5)
CCL['returns'].plot(kind = 'kde', label ='CCL', alpha=0.5)
CMG['returns'].plot(kind = 'kde', label ='CMG', alpha=0.5)
DHI['returns'].plot(kind = 'kde', label ='DHI', alpha=0.5)
DRI['returns'].plot(kind = 'kde', label ='DRI', alpha=0.5)
DG['returns'].plot(kind = 'kde', label ='DG', alpha=0.5)
DLTR['returns'].plot(kind = 'kde', label ='DLTR', alpha=0.5)
DPZ['returns'].plot(kind = 'kde', label = 'DPZ', alpha=0.5)
EBAY['returns'].plot(kind = 'kde', label ='EBAY', alpha=0.5)
EXPE['returns'].plot(kind = 'kde', label ='EXPE', alpha=0.5)
F['returns'].plot(kind = 'kde', label ='F', alpha=0.5)
GPS['returns'].plot(kind = 'kde', label ='GPS', alpha=0.5)
GRMN['returns'].plot(kind = 'kde', label ='GRMN', alpha=0.5)
GM['returns'].plot(kind = 'kde', label ='GM', alpha=0.5)
GPC['returns'].plot(kind = 'kde', label ='GPC', alpha=0.5)
HRB['returns'].plot(kind = 'kde', label ='HRB', alpha=0.5)
HBI['returns'].plot(kind = 'kde', label ='HBI', alpha=0.5)
HOG['returns'].plot(kind = 'kde', label ='HOG', alpha=0.5)
HAS['returns'].plot(kind = 'kde', label ='HAS', alpha=0.5)
HLT['returns'].plot(kind = 'kde', label ='HLT', alpha=0.5)
HD['returns'].plot(kind = 'kde', label ='HD', alpha=0.5)
KSS['returns'].plot(kind = 'kde', label ='KSS', alpha=0.5)
LB['returns'].plot(kind = 'kde', label ='LB', alpha=0.5)
LVS['returns'].plot(kind = 'kde', label ='LVS', alpha=0.5)
LEG['returns'].plot(kind = 'kde', label ='LEG', alpha=0.5)
LEN['returns'].plot(kind = 'kde', label ='LEN', alpha=0.5)
LKQ['returns'].plot(kind = 'kde', label ='LKQ', alpha=0.5)
LOW['returns'].plot(kind = 'kde', label ='LOW', alpha=0.5)
MAR['returns'].plot(kind = 'kde', label ='MAR', alpha=0.5)
MCD['returns'].plot(kind = 'kde', label ='MCD', alpha=0.5)
MGM['returns'].plot(kind = 'kde', label ='MGM', alpha=0.5)
MHK['returns'].plot(kind = 'kde', label ='MHK', alpha=0.5)
NWL['returns'].plot(kind = 'kde', label ='NWL', alpha=0.5)
NKE['returns'].plot(kind = 'kde', label ='NKE', alpha=0.5)
JWN['returns'].plot(kind = 'kde', label ='JWN', alpha=0.5)
NCLH['returns'].plot(kind = 'kde', label ='NCLH', alpha=0.5)
NVR['returns'].plot(kind = 'kde', label ='NVR', alpha=0.5)
ORLY['returns'].plot(kind = 'kde', label ='ORLY', alpha=0.5)
PHM['returns'].plot(kind = 'kde', label ='PHM', alpha=0.5)
PVH['returns'].plot(kind = 'kde', label ='PVH', alpha=0.5)
RL['returns'].plot(kind = 'kde', label ='RL', alpha=0.5)
ROST['returns'].plot(kind = 'kde', label ='ROST', alpha=0.5)
RCL['returns'].plot(kind = 'kde', label ='RCL', alpha=0.5)
SBUX['returns'].plot(kind = 'kde', label ='SBUX', alpha=0.5)
TPR['returns'].plot(kind = 'kde', label ='TPR', alpha=0.5)
TGT['returns'].plot(kind = 'kde', label ='TGT', alpha=0.5)
TIF['returns'].plot(kind = 'kde', label ='TIF', alpha=0.5)
TJX['returns'].plot(kind = 'kde', label ='TJX', alpha=0.5)
TSCO['returns'].plot(kind = 'kde', label ='TSCO', alpha=0.5)
ULTA['returns'].plot(kind = 'kde', label ='ULTA', alpha=0.5)
UAA['returns'].plot(kind = 'kde', label ='UAA', alpha=0.5)
UA['returns'].plot(kind = 'kde', label ='UA', alpha=0.5)
VFC['returns'].plot(kind = 'kde', label ='VFC', alpha=0.5)
WHR['returns'].plot(kind = 'kde', label ='WHR', alpha=0.5)
WYNN['returns'].plot(kind = 'kde', label ='WYNN', alpha=0.5)
YUM['returns'].plot(kind = 'kde', label ='YUM', alpha=0.5)
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Boxplots comparing returns for Consumer Discretionary Sector
box_df = pd.concat([sp['returns'],AAP['returns'],AMZN['returns'],APTV['returns'],AZO['returns'],BBY['returns'],BKNG['returns'],BWA['returns'],KMX['returns'],CCL['returns'],CMG['returns'],DHI['returns'],DRI['returns'],DG['returns'],DLTR['returns'],DPZ['returns'],EBAY['returns'],EXPE['returns'],F['returns'],GPS['returns'],GRMN['returns'],GM['returns'],GPC['returns'],HRB['returns'],HBI['returns'],HOG['returns'],HAS['returns'],HLT['returns'],HD['returns'],KSS['returns'],LB['returns'],LVS['returns'],LEG['returns'],LEN['returns'],LKQ['returns'],LOW['returns'],MAR['returns'],MCD['returns'],MGM['returns'],MHK['returns'],NWL['returns'],NKE['returns'],JWN['returns'],NCLH['returns'],NVR['returns'],ORLY['returns'],PHM['returns'],PVH['returns'],RL['returns'],ROST['returns'],RCL['returns'],SBUX['returns'],TPR['returns'],TGT['returns'],TIF['returns'],TJX['returns'],TSCO['returns'],ULTA['returns'],UAA['returns'],UA['returns'],VFC['returns'],WHR['returns'],WYNN['returns'],YUM['returns']], axis=1)
box_df.columns = ['S&P 500','AAP','AMZN','APTV','AZO','BBY','BKNG','BWA','KMX','CCL','CMG','DHI','DRI','DG','DLTR','DPZ','EBAY','EXPE','F','GPS','GRMN','GM','GPC','HRB','HBI','HOG','HAS','HLT','HD','KSS','LB','LVS','LEG','LEN','LKQ','LOW','MAR','MCD','MGM','MHK','NWL','NKE','JWN','NCLH','NVR','ORLY','PHM','PVH','RL','ROST','RCL','SBUX','TPR','TGT','TIF','TJX','TSCO','ULTA','UAA','UA','VFC','WHR','WYNN','YUM']
box_df.plot(kind='box', figsize=(30,10), colormap= 'jet', title = 'Boxplots of Consumer Discretionary Sector Returns')
#Cumulative Returns of Consumer Discretionary Stocks for Whole period
sp['Cumulative Return'].plot(label="S&P 500")
AAP['Cumulative Return'].plot(label='AAP', figsize=(16,8), title = 'Cumulative Return of Consumer Discretionary Stocks')
AMZN['Cumulative Return'].plot(label="AMZN")
APTV['Cumulative Return'].plot(label="APTV")
AZO['Cumulative Return'].plot(label="AZO")
BBY['Cumulative Return'].plot(label="BBY")
BKNG['Cumulative Return'].plot(label="BKNG")
BWA['Cumulative Return'].plot(label="BWA")
KMX['Cumulative Return'].plot(label="KMX")
CCL['Cumulative Return'].plot(label="CCL")
CMG['Cumulative Return'].plot(label="CMG")
DHI['Cumulative Return'].plot(label="DHI")
DRI['Cumulative Return'].plot(label="DRI")
DG['Cumulative Return'].plot(label="DG")
DLTR['Cumulative Return'].plot(label="DLTR")
DPZ['Cumulative Return'].plot(label="DPZ")
EBAY['Cumulative Return'].plot(label="EBAY")
EXPE['Cumulative Return'].plot(label="EXPE")
F['Cumulative Return'].plot(label="F")
GPS['Cumulative Return'].plot(label="GPS")
GRMN['Cumulative Return'].plot(label="GRMN")
GM['Cumulative Return'].plot(label="GM")
GPC['Cumulative Return'].plot(label="GPC")
HRB['Cumulative Return'].plot(label="HRB")
HBI['Cumulative Return'].plot(label="HBI")
HOG['Cumulative Return'].plot(label="HOG")
HAS['Cumulative Return'].plot(label="HAS")
HLT['Cumulative Return'].plot(label="HLT")
HD['Cumulative Return'].plot(label="HD")
KSS['Cumulative Return'].plot(label="KSS")
LB['Cumulative Return'].plot(label="LB")
LVS['Cumulative Return'].plot(label="LVS")
LEG['Cumulative Return'].plot(label="LEG")
LEN['Cumulative Return'].plot(label="LEN")
LKQ['Cumulative Return'].plot(label="LKQ")
LOW['Cumulative Return'].plot(label="LOW")
MAR['Cumulative Return'].plot(label="MAR")
MCD['Cumulative Return'].plot(label="MCD")
MGM['Cumulative Return'].plot(label="MGM")
MHK['Cumulative Return'].plot(label="MHK")
NWL['Cumulative Return'].plot(label="NWL")
NKE['Cumulative Return'].plot(label="NKE")
JWN['Cumulative Return'].plot(label="JWN")
NCLH['Cumulative Return'].plot(label="NCLH")
NVR['Cumulative Return'].plot(label="NVR")
ORLY['Cumulative Return'].plot(label="ORLY")
PHM['Cumulative Return'].plot(label="PHM")
PVH['Cumulative Return'].plot(label="PVH")
RL['Cumulative Return'].plot(label="RL")
ROST['Cumulative Return'].plot(label="ROST")
RCL['Cumulative Return'].plot(label="RCL")
SBUX['Cumulative Return'].plot(label="SBUX")
TPR['Cumulative Return'].plot(label="TPR")
TGT['Cumulative Return'].plot(label="TGT")
TIF['Cumulative Return'].plot(label="TIF")
TJX['Cumulative Return'].plot(label="TJX")
TSCO['Cumulative Return'].plot(label="TSCO")
ULTA['Cumulative Return'].plot(label="ULTA")
UAA['Cumulative Return'].plot(label="UAA")
UA['Cumulative Return'].plot(label="UA")
VFC['Cumulative Return'].plot(label="VFC")
WHR['Cumulative Return'].plot(label="WHR")
WYNN['Cumulative Return'].plot(label="WYNN")
YUM['Cumulative Return'].plot(label="YUM")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Sorting by Cumulative Return
cumret = {'Cumulative Returns 12/4-6/5': [sp['Cumulative Return'].iloc[-1],AAP['Cumulative Return'].iloc[-1],AMZN['Cumulative Return'].iloc[-1],APTV['Cumulative Return'].iloc[-1],AZO['Cumulative Return'].iloc[-1],BBY['Cumulative Return'].iloc[-1],BKNG['Cumulative Return'].iloc[-1],BWA['Cumulative Return'].iloc[-1],KMX['Cumulative Return'].iloc[-1],CCL['Cumulative Return'].iloc[-1],CMG['Cumulative Return'].iloc[-1],DHI['Cumulative Return'].iloc[-1],DRI['Cumulative Return'].iloc[-1],DG['Cumulative Return'].iloc[-1],DLTR['Cumulative Return'].iloc[-1],DPZ['Cumulative Return'].iloc[-1],EBAY['Cumulative Return'].iloc[-1],EXPE['Cumulative Return'].iloc[-1],F['Cumulative Return'].iloc[-1],GPS['Cumulative Return'].iloc[-1],GRMN['Cumulative Return'].iloc[-1],GM['Cumulative Return'].iloc[-1],GPC['Cumulative Return'].iloc[-1],HRB['Cumulative Return'].iloc[-1],HBI['Cumulative Return'].iloc[-1],HOG['Cumulative Return'].iloc[-1],HAS['Cumulative Return'].iloc[-1],HLT['Cumulative Return'].iloc[-1],HD['Cumulative Return'].iloc[-1],KSS['Cumulative Return'].iloc[-1],LB['Cumulative Return'].iloc[-1],LVS['Cumulative Return'].iloc[-1],LEG['Cumulative Return'].iloc[-1],LEN['Cumulative Return'].iloc[-1],LKQ['Cumulative Return'].iloc[-1],LOW['Cumulative Return'].iloc[-1],MAR['Cumulative Return'].iloc[-1],MCD['Cumulative Return'].iloc[-1],MGM['Cumulative Return'].iloc[-1],MHK['Cumulative Return'].iloc[-1],NWL['Cumulative Return'].iloc[-1],NKE['Cumulative Return'].iloc[-1],JWN['Cumulative Return'].iloc[-1],NCLH['Cumulative Return'].iloc[-1],NVR['Cumulative Return'].iloc[-1],ORLY['Cumulative Return'].iloc[-1],PHM['Cumulative Return'].iloc[-1],PVH['Cumulative Return'].iloc[-1],RL['Cumulative Return'].iloc[-1],ROST['Cumulative Return'].iloc[-1],RCL['Cumulative Return'].iloc[-1],SBUX['Cumulative Return'].iloc[-1],TPR['Cumulative Return'].iloc[-1],TGT['Cumulative Return'].iloc[-1],TIF['Cumulative Return'].iloc[-1],TJX['Cumulative Return'].iloc[-1],TSCO['Cumulative Return'].iloc[-1],ULTA['Cumulative Return'].iloc[-1],UAA['Cumulative Return'].iloc[-1],UA['Cumulative Return'].iloc[-1],VFC['Cumulative Return'].iloc[-1],WHR['Cumulative Return'].iloc[-1],WYNN['Cumulative Return'].iloc[-1],YUM['Cumulative Return'].iloc[-1]],
'Cumulative Returns 12/4-2/20': [spbef['Cumulative Return Before Crash'].iloc[-1],AAPbef['Cumulative Return Before Crash'].iloc[-1],AMZNbef['Cumulative Return Before Crash'].iloc[-1],APTVbef['Cumulative Return Before Crash'].iloc[-1],AZObef['Cumulative Return Before Crash'].iloc[-1],BBYbef['Cumulative Return Before Crash'].iloc[-1],BKNGbef['Cumulative Return Before Crash'].iloc[-1],BWAbef['Cumulative Return Before Crash'].iloc[-1],KMXbef['Cumulative Return Before Crash'].iloc[-1],CCLbef['Cumulative Return Before Crash'].iloc[-1],CMGbef['Cumulative Return Before Crash'].iloc[-1],DHIbef['Cumulative Return Before Crash'].iloc[-1],DRIbef['Cumulative Return Before Crash'].iloc[-1],DGbef['Cumulative Return Before Crash'].iloc[-1],DLTRbef['Cumulative Return Before Crash'].iloc[-1],DPZbef['Cumulative Return Before Crash'].iloc[-1],EBAYbef['Cumulative Return Before Crash'].iloc[-1],EXPEbef['Cumulative Return Before Crash'].iloc[-1],Fbef['Cumulative Return Before Crash'].iloc[-1],GPSbef['Cumulative Return Before Crash'].iloc[-1],GRMNbef['Cumulative Return Before Crash'].iloc[-1],GMbef['Cumulative Return Before Crash'].iloc[-1],GPCbef['Cumulative Return Before Crash'].iloc[-1],HRBbef['Cumulative Return Before Crash'].iloc[-1],HBIbef['Cumulative Return Before Crash'].iloc[-1],HOGbef['Cumulative Return Before Crash'].iloc[-1],HASbef['Cumulative Return Before Crash'].iloc[-1],HLTbef['Cumulative Return Before Crash'].iloc[-1],HDbef['Cumulative Return Before Crash'].iloc[-1],KSSbef['Cumulative Return Before Crash'].iloc[-1],LBbef['Cumulative Return Before Crash'].iloc[-1],LVSbef['Cumulative Return Before Crash'].iloc[-1],LEGbef['Cumulative Return Before Crash'].iloc[-1],LENbef['Cumulative Return Before Crash'].iloc[-1],LKQbef['Cumulative Return Before Crash'].iloc[-1],LOWbef['Cumulative Return Before Crash'].iloc[-1],MARbef['Cumulative Return Before Crash'].iloc[-1],MCDbef['Cumulative Return Before Crash'].iloc[-1],MGMbef['Cumulative Return Before Crash'].iloc[-1],MHKbef['Cumulative Return Before Crash'].iloc[-1],NWLbef['Cumulative Return Before Crash'].iloc[-1],NKEbef['Cumulative Return Before Crash'].iloc[-1],JWNbef['Cumulative Return Before Crash'].iloc[-1],NCLHbef['Cumulative Return Before Crash'].iloc[-1],NVRbef['Cumulative Return Before Crash'].iloc[-1],ORLYbef['Cumulative Return Before Crash'].iloc[-1],PHMbef['Cumulative Return Before Crash'].iloc[-1],PVHbef['Cumulative Return Before Crash'].iloc[-1],RLbef['Cumulative Return Before Crash'].iloc[-1],ROSTbef['Cumulative Return Before Crash'].iloc[-1],RCLbef['Cumulative Return Before Crash'].iloc[-1],SBUXbef['Cumulative Return Before Crash'].iloc[-1],TPRbef['Cumulative Return Before Crash'].iloc[-1],TGTbef['Cumulative Return Before Crash'].iloc[-1],TIFbef['Cumulative Return Before Crash'].iloc[-1],TJXbef['Cumulative Return Before Crash'].iloc[-1],TSCObef['Cumulative Return Before Crash'].iloc[-1],ULTAbef['Cumulative Return Before Crash'].iloc[-1],UAAbef['Cumulative Return Before Crash'].iloc[-1],UAbef['Cumulative Return Before Crash'].iloc[-1],VFCbef['Cumulative Return Before Crash'].iloc[-1],WHRbef['Cumulative Return Before Crash'].iloc[-1],WYNNbef['Cumulative Return Before Crash'].iloc[-1],YUMbef['Cumulative Return Before Crash'].iloc[-1]],
'Cumulative Returns 2/20-3/23': [spdur['Cumulative Return During Crash'].iloc[-1],AAPdur['Cumulative Return During Crash'].iloc[-1],AMZNdur['Cumulative Return During Crash'].iloc[-1],APTVdur['Cumulative Return During Crash'].iloc[-1],AZOdur['Cumulative Return During Crash'].iloc[-1],BBYdur['Cumulative Return During Crash'].iloc[-1],BKNGdur['Cumulative Return During Crash'].iloc[-1],BWAdur['Cumulative Return During Crash'].iloc[-1],KMXdur['Cumulative Return During Crash'].iloc[-1],CCLdur['Cumulative Return During Crash'].iloc[-1],CMGdur['Cumulative Return During Crash'].iloc[-1],DHIdur['Cumulative Return During Crash'].iloc[-1],DRIdur['Cumulative Return During Crash'].iloc[-1],DGdur['Cumulative Return During Crash'].iloc[-1],DLTRdur['Cumulative Return During Crash'].iloc[-1],DPZdur['Cumulative Return During Crash'].iloc[-1],EBAYdur['Cumulative Return During Crash'].iloc[-1],EXPEdur['Cumulative Return During Crash'].iloc[-1],Fdur['Cumulative Return During Crash'].iloc[-1],GPSdur['Cumulative Return During Crash'].iloc[-1],GRMNdur['Cumulative Return During Crash'].iloc[-1],GMdur['Cumulative Return During Crash'].iloc[-1],GPCdur['Cumulative Return During Crash'].iloc[-1],HRBdur['Cumulative Return During Crash'].iloc[-1],HBIdur['Cumulative Return During Crash'].iloc[-1],HOGdur['Cumulative Return During Crash'].iloc[-1],HASdur['Cumulative Return During Crash'].iloc[-1],HLTdur['Cumulative Return During Crash'].iloc[-1],HDdur['Cumulative Return During Crash'].iloc[-1],KSSdur['Cumulative Return During Crash'].iloc[-1],LBdur['Cumulative Return During Crash'].iloc[-1],LVSdur['Cumulative Return During Crash'].iloc[-1],LEGdur['Cumulative Return During Crash'].iloc[-1],LENdur['Cumulative Return During Crash'].iloc[-1],LKQdur['Cumulative Return During Crash'].iloc[-1],LOWdur['Cumulative Return During Crash'].iloc[-1],MARdur['Cumulative Return During Crash'].iloc[-1],MCDdur['Cumulative Return During Crash'].iloc[-1],MGMdur['Cumulative Return During Crash'].iloc[-1],MHKdur['Cumulative Return During Crash'].iloc[-1],NWLdur['Cumulative Return During Crash'].iloc[-1],NKEdur['Cumulative Return During Crash'].iloc[-1],JWNdur['Cumulative Return During Crash'].iloc[-1],NCLHdur['Cumulative Return During Crash'].iloc[-1],NVRdur['Cumulative Return During Crash'].iloc[-1],ORLYdur['Cumulative Return During Crash'].iloc[-1],PHMdur['Cumulative Return During Crash'].iloc[-1],PVHdur['Cumulative Return During Crash'].iloc[-1],RLdur['Cumulative Return During Crash'].iloc[-1],ROSTdur['Cumulative Return During Crash'].iloc[-1],RCLdur['Cumulative Return During Crash'].iloc[-1],SBUXdur['Cumulative Return During Crash'].iloc[-1],TPRdur['Cumulative Return During Crash'].iloc[-1],TGTdur['Cumulative Return During Crash'].iloc[-1],TIFdur['Cumulative Return During Crash'].iloc[-1],TJXdur['Cumulative Return During Crash'].iloc[-1],TSCOdur['Cumulative Return During Crash'].iloc[-1],ULTAdur['Cumulative Return During Crash'].iloc[-1],UAAdur['Cumulative Return During Crash'].iloc[-1],UAdur['Cumulative Return During Crash'].iloc[-1],VFCdur['Cumulative Return During Crash'].iloc[-1],WHRdur['Cumulative Return During Crash'].iloc[-1],WYNNdur['Cumulative Return During Crash'].iloc[-1],YUMdur['Cumulative Return During Crash'].iloc[-1]],
'Cumulative Returns 3/23-6/5': [spaft['Cumulative Return After Crash'].iloc[-1],AAPaft['Cumulative Return After Crash'].iloc[-1],AMZNaft['Cumulative Return After Crash'].iloc[-1],APTVaft['Cumulative Return After Crash'].iloc[-1],AZOaft['Cumulative Return After Crash'].iloc[-1],BBYaft['Cumulative Return After Crash'].iloc[-1],BKNGaft['Cumulative Return After Crash'].iloc[-1],BWAaft['Cumulative Return After Crash'].iloc[-1],KMXaft['Cumulative Return After Crash'].iloc[-1],CCLaft['Cumulative Return After Crash'].iloc[-1],CMGaft['Cumulative Return After Crash'].iloc[-1],DHIaft['Cumulative Return After Crash'].iloc[-1],DRIaft['Cumulative Return After Crash'].iloc[-1],DGaft['Cumulative Return After Crash'].iloc[-1],DLTRaft['Cumulative Return After Crash'].iloc[-1],DPZaft['Cumulative Return After Crash'].iloc[-1],EBAYaft['Cumulative Return After Crash'].iloc[-1],EXPEaft['Cumulative Return After Crash'].iloc[-1],Faft['Cumulative Return After Crash'].iloc[-1],GPSaft['Cumulative Return After Crash'].iloc[-1],GRMNaft['Cumulative Return After Crash'].iloc[-1],GMaft['Cumulative Return After Crash'].iloc[-1],GPCaft['Cumulative Return After Crash'].iloc[-1],HRBaft['Cumulative Return After Crash'].iloc[-1],HBIaft['Cumulative Return After Crash'].iloc[-1],HOGaft['Cumulative Return After Crash'].iloc[-1],HASaft['Cumulative Return After Crash'].iloc[-1],HLTaft['Cumulative Return After Crash'].iloc[-1],HDaft['Cumulative Return After Crash'].iloc[-1],KSSaft['Cumulative Return After Crash'].iloc[-1],LBaft['Cumulative Return After Crash'].iloc[-1],LVSaft['Cumulative Return After Crash'].iloc[-1],LEGaft['Cumulative Return After Crash'].iloc[-1],LENaft['Cumulative Return After Crash'].iloc[-1],LKQaft['Cumulative Return After Crash'].iloc[-1],LOWaft['Cumulative Return After Crash'].iloc[-1],MARaft['Cumulative Return After Crash'].iloc[-1],MCDaft['Cumulative Return After Crash'].iloc[-1],MGMaft['Cumulative Return After Crash'].iloc[-1],MHKaft['Cumulative Return After Crash'].iloc[-1],NWLaft['Cumulative Return After Crash'].iloc[-1],NKEaft['Cumulative Return After Crash'].iloc[-1],JWNaft['Cumulative Return After Crash'].iloc[-1],NCLHaft['Cumulative Return After Crash'].iloc[-1],NVRaft['Cumulative Return After Crash'].iloc[-1],ORLYaft['Cumulative Return After Crash'].iloc[-1],PHMaft['Cumulative Return After Crash'].iloc[-1],PVHaft['Cumulative Return After Crash'].iloc[-1],RLaft['Cumulative Return After Crash'].iloc[-1],ROSTaft['Cumulative Return After Crash'].iloc[-1],RCLaft['Cumulative Return After Crash'].iloc[-1],SBUXaft['Cumulative Return After Crash'].iloc[-1],TPRaft['Cumulative Return After Crash'].iloc[-1],TGTaft['Cumulative Return After Crash'].iloc[-1],TIFaft['Cumulative Return After Crash'].iloc[-1],TJXaft['Cumulative Return After Crash'].iloc[-1],TSCOaft['Cumulative Return After Crash'].iloc[-1],ULTAaft['Cumulative Return After Crash'].iloc[-1],UAAaft['Cumulative Return After Crash'].iloc[-1],UAaft['Cumulative Return After Crash'].iloc[-1],VFCaft['Cumulative Return After Crash'].iloc[-1],WHRaft['Cumulative Return After Crash'].iloc[-1],WYNNaft['Cumulative Return After Crash'].iloc[-1],YUMaft['Cumulative Return After Crash'].iloc[-1]]}
cddf2 = pd.DataFrame(cumret, columns = ['Cumulative Returns 12/4-6/5', 'Cumulative Returns 12/4-2/20', 'Cumulative Returns 2/20-3/23', 'Cumulative Returns 3/23-6/5'], index= ['S&P 500','AAP','AMZN','APTV','AZO','BBY','BKNG','BWA','KMX','CCL','CMG','DHI','DRI','DG','DLTR','DPZ','EBAY','EXPE','F','GPS','GRMN','GM','GPC','HRB','HBI','HOG','HAS','HLT','HD','KSS','LB','LVS','LEG','LEN','LKQ','LOW','MAR','MCD','MGM','MHK','NWL','NKE','JWN','NCLH','NVR','ORLY','PHM','PVH','RL','ROST','RCL','SBUX','TPR','TGT','TIF','TJX','TSCO','ULTA','UAA','UA','VFC','WHR','WYNN','YUM'])
pd.DataFrame(cddf2)
cddf2.sort_values('Cumulative Returns 3/23-6/5', ascending=False)
#Table of Key Statistics of Consumer Discretionary Stocks
import pandas as pd
import statistics as stats
cdmeans = [AAPmean,AMZNmean,APTVmean,AZOmean,BBYmean,BKNGmean,BWAmean,KMXmean,CCLmean,CMGmean,DHImean,DRImean,DGmean,DLTRmean,DPZmean,EBAYmean,EXPEmean,Fmean,GPSmean,GRMNmean,GMmean,GPCmean,HRBmean,HBImean,HOGmean,HASmean,HLTmean,HDmean,KSSmean,LBmean,LVSmean,LEGmean,LENmean,LKQmean,LOWmean,MARmean,MCDmean,MGMmean,MHKmean,NWLmean,NKEmean,JWNmean,NCLHmean,NVRmean,ORLYmean,PHMmean,PVHmean,RLmean,ROSTmean,RCLmean,SBUXmean,TPRmean,TGTmean,TIFmean,TJXmean,TSCOmean,ULTAmean,UAAmean,UAmean,VFCmean,WHRmean,WYNNmean,YUMmean]
cdaveragemean = stats.mean(cdmeans)
cdvariances = [AAPvar,AMZNvar,APTVvar,AZOvar,BBYvar,BKNGvar,BWAvar,KMXvar,CCLvar,CMGvar,DHIvar,DRIvar,DGvar,DLTRvar,DPZvar,EBAYvar,EXPEvar,Fvar,GPSvar,GRMNvar,GMvar,GPCvar,HRBvar,HBIvar,HOGvar,HASvar,HLTvar,HDvar,KSSvar,LBvar,LVSvar,LEGvar,LENvar,LKQvar,LOWvar,MARvar,MCDvar,MGMvar,MHKvar,NWLvar,NKEvar,JWNvar,NCLHvar,NVRvar,ORLYvar,PHMvar,PVHvar,RLvar,ROSTvar,RCLvar,SBUXvar,TPRvar,TGTvar,TIFvar,TJXvar,TSCOvar,ULTAvar,UAAvar,UAvar,VFCvar,WHRvar,WYNNvar,YUMvar]
cdaveragevar = stats.mean(cdvariances)
cdkurtoses = [AAPkurt,AMZNkurt,APTVkurt,AZOkurt,BBYkurt,BKNGkurt,BWAkurt,KMXkurt,CCLkurt,CMGkurt,DHIkurt,DRIkurt,DGkurt,DLTRkurt,DPZkurt,EBAYkurt,EXPEkurt,Fkurt,GPSkurt,GRMNkurt,GMkurt,GPCkurt,HRBkurt,HBIkurt,HOGkurt,HASkurt,HLTkurt,HDkurt,KSSkurt,LBkurt,LVSkurt,LEGkurt,LENkurt,LKQkurt,LOWkurt,MARkurt,MCDkurt,MGMkurt,MHKkurt,NWLkurt,NKEkurt,JWNkurt,NCLHkurt,NVRkurt,ORLYkurt,PHMkurt,PVHkurt,RLkurt,ROSTkurt,RCLkurt,SBUXkurt,TPRkurt,TGTkurt,TIFkurt,TJXkurt,TSCOkurt,ULTAkurt,UAAkurt,UAkurt,VFCkurt,WHRkurt,WYNNkurt,YUMkurt]
cdaveragekurt = stats.mean(cdkurtoses)
cdskews = [AAPskew,AMZNskew,APTVskew,AZOskew,BBYskew,BKNGskew,BWAskew,KMXskew,CCLskew,CMGskew,DHIskew,DRIskew,DGskew,DLTRskew,DPZskew,EBAYskew,EXPEskew,Fskew,GPSskew,GRMNskew,GMskew,GPCskew,HRBskew,HBIskew,HOGskew,HASskew,HLTskew,HDskew,KSSskew,LBskew,LVSskew,LEGskew,LENskew,LKQskew,LOWskew,MARskew,MCDskew,MGMskew,MHKskew,NWLskew,NKEskew,JWNskew,NCLHskew,NVRskew,ORLYskew,PHMskew,PVHskew,RLskew,ROSTskew,RCLskew,SBUXskew,TPRskew,TGTskew,TIFskew,TJXskew,TSCOskew,ULTAskew,UAAskew,UAskew,VFCskew,WHRskew,WYNNskew,YUMskew]
cdaverageskew = stats.mean(cdskews)
Consumer_Discretionary = {'Mean': [[spmean],[cdaveragemean],[AAPmean], [AMZNmean],[APTVmean],[AZOmean],[BBYmean],[BKNGmean],[BWAmean],[KMXmean],[CCLmean],[CMGmean],[DHImean],[DRImean],[DGmean],[DLTRmean],[DPZmean],[EBAYmean],[EXPEmean],[Fmean],[GPSmean],[GRMNmean],[GMmean],[GPCmean],[HRBmean],[HBImean],[HOGmean],[HASmean],[HLTmean],[HDmean],[KSSmean],[LBmean],[LVSmean],[LEGmean],[LENmean],[LKQmean],[LOWmean],[MARmean],[MCDmean],[MGMmean],[MHKmean],[NWLmean],[NKEmean],[JWNmean],[NCLHmean],[NVRmean],[ORLYmean],[PHMmean],[PVHmean],[RLmean],[ROSTmean],[RCLmean],[SBUXmean],[TPRmean],[TGTmean],[TIFmean],[TJXmean],[TSCOmean],[ULTAmean],[UAAmean],[UAmean],[VFCmean],[WHRmean],[WYNNmean],[YUMmean]],
'Variance': [[spvar],[cdaveragevar],[AAPvar],[AMZNvar],[APTVvar],[AZOvar],[BBYvar],[BKNGvar],[BWAvar],[KMXvar],[CCLvar],[CMGvar],[DHIvar],[DRIvar],[DGvar],[DLTRvar],[DPZvar],[EBAYvar],[EXPEvar],[Fvar],[GPSvar],[GRMNvar],[GMvar],[GPCvar],[HRBvar],[HBIvar],[HOGvar],[HASvar],[HLTvar],[HDvar],[KSSvar],[LBvar],[LVSvar],[LEGvar],[LENvar],[LKQvar],[LOWvar],[MARvar],[MCDvar],[MGMvar],[MHKvar],[NWLvar],[NKEvar],[JWNvar],[NCLHvar],[NVRvar],[ORLYvar],[PHMvar],[PVHvar],[RLvar],[ROSTvar],[RCLvar],[SBUXvar],[TPRvar],[TGTvar],[TIFvar],[TJXvar],[TSCOvar],[ULTAvar],[UAAvar],[UAvar],[VFCvar],[WHRvar],[WYNNvar],[YUMvar]],
'Kurtosis': [[spkurt],[cdaveragekurt],[AAPkurt],[AMZNkurt],[APTVkurt],[AZOkurt],[BBYkurt],[BKNGkurt],[BWAkurt],[KMXkurt],[CCLkurt],[CMGkurt],[DHIkurt],[DRIkurt],[DGkurt],[DLTRkurt],[DPZkurt],[EBAYkurt],[EXPEkurt],[Fkurt],[GPSkurt],[GRMNkurt],[GMkurt],[GPCkurt],[HRBkurt],[HBIkurt],[HOGkurt],[HASkurt],[HLTkurt],[HDkurt],[KSSkurt],[LBkurt],[LVSkurt],[LEGkurt],[LENkurt],[LKQkurt],[LOWkurt],[MARkurt],[MCDkurt],[MGMkurt],[MHKkurt],[NWLkurt],[NKEkurt],[JWNkurt],[NCLHkurt],[NVRkurt],[ORLYkurt],[PHMkurt],[PVHkurt],[RLkurt],[ROSTkurt],[RCLkurt],[SBUXkurt],[TPRkurt],[TGTkurt],[TIFkurt],[TJXkurt],[TSCOkurt],[ULTAkurt],[UAAkurt],[UAkurt],[VFCkurt],[WHRkurt],[WYNNkurt],[YUMkurt]],
'Skew': [[spskew],[cdaverageskew],[AAPskew],[AMZNskew],[APTVskew],[AZOskew],[BBYskew],[BKNGskew],[BWAskew],[KMXskew],[CCLskew],[CMGskew],[DHIskew],[DRIskew],[DGskew],[DLTRskew],[DPZskew],[EBAYskew],[EXPEskew],[Fskew],[GPSskew],[GRMNskew],[GMskew],[GPCskew],[HRBskew],[HBIskew],[HOGskew],[HASskew],[HLTskew],[HDskew],[KSSskew],[LBskew],[LVSskew],[LEGskew],[LENskew],[LKQskew],[LOWskew],[MARskew],[MCDskew],[MGMskew],[MHKskew],[NWLskew],[NKEskew],[JWNskew],[NCLHskew],[NVRskew],[ORLYskew],[PHMskew],[PVHskew],[RLskew],[ROSTskew],[RCLskew],[SBUXskew],[TPRskew],[TGTskew],[TIFskew],[TJXskew],[TSCOskew],[ULTAskew],[UAAskew],[UAskew],[VFCskew],[WHRskew],[WYNNskew],[YUMskew]],
}
cddf = pd.DataFrame(Consumer_Discretionary, columns = ['Mean', 'Variance', 'Kurtosis', 'Skew'], index= ['S&P 500','Average','AAP','AMZN','APTV','AZO','BBY','BKNG','BWA','KMX','CCL','CMG','DHI','DRI','DG','DLTR','DPZ','EBAY','EXPE','F','GPS','GRMN','GM','GPC','HRB','HBI','HOG','HAS','HLT','HD','KSS','LB','LVS','LEG','LEN','LKQ','LOW','MAR','MCD','MGM','MHK','NWL','NKE','JWN','NCLH','NVR','ORLY','PHM','PVH','RL','ROST','RCL','SBUX','TPR','TGT','TIF','TJX','TSCO','ULTA','UAA','UA','VFC','WHR','WYNN','YUM']
)
pd.DataFrame(cddf)
cddf.sort_values("Mean", ascending=False)
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MO = web.DataReader('MO', 'yahoo', start, end)
MO['returns'] = MO['Close'].pct_change(1)
MO['Cumulative Return'] = (1 + MO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MOmean = MO['returns'].mean()
MOvar = MO['returns'].var()
MOkurt = MO['returns'].kurt()
MOskew = MO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MObef = web.DataReader('MO', 'yahoo', start, crashstart)
MObef['avgreturnbefore'] = MObef['Close'].pct_change(1)
MObef['Cumulative Return Before Crash'] = (1 + MObef['avgreturnbefore']).cumprod()
#period of crash
MOdur = web.DataReader('MO', 'yahoo', crashstart, crashend)
MOdur['avgreturnduring'] = MOdur['Close'].pct_change(1)
MOdur['Cumulative Return During Crash'] = (1 + MOdur['avgreturnduring']).cumprod()
#period after crash
MOaft = web.DataReader('MO', 'yahoo', crashend, end)
MOaft['avgreturnafter'] = MOaft['Close'].pct_change(1)
MOaft['Cumulative Return After Crash'] = (1 + MOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ADM = web.DataReader('ADM', 'yahoo', start, end)
ADM['returns'] = ADM['Close'].pct_change(1)
ADM['Cumulative Return'] = (1 + ADM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ADMmean = ADM['returns'].mean()
ADMvar = ADM['returns'].var()
ADMkurt = ADM['returns'].kurt()
ADMskew = ADM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ADMbef = web.DataReader('ADM', 'yahoo', start, crashstart)
ADMbef['avgreturnbefore'] = ADMbef['Close'].pct_change(1)
ADMbef['Cumulative Return Before Crash'] = (1 + ADMbef['avgreturnbefore']).cumprod()
#period of crash
ADMdur = web.DataReader('ADM', 'yahoo', crashstart, crashend)
ADMdur['avgreturnduring'] = ADMdur['Close'].pct_change(1)
ADMdur['Cumulative Return During Crash'] = (1 + ADMdur['avgreturnduring']).cumprod()
#period after crash
ADMaft = web.DataReader('ADM', 'yahoo', crashend, end)
ADMaft['avgreturnafter'] = ADMaft['Close'].pct_change(1)
ADMaft['Cumulative Return After Crash'] = (1 + ADMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BFB = web.DataReader('BF-B', 'yahoo', start, end)
BFB['returns'] = BFB['Close'].pct_change(1)
BFB['Cumulative Return'] = (1 + BFB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BFBmean = BFB['returns'].mean()
BFBvar = BFB['returns'].var()
BFBkurt = BFB['returns'].kurt()
BFBskew = BFB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BFBbef = web.DataReader('BF-B', 'yahoo', start, crashstart)
BFBbef['avgreturnbefore'] = BFBbef['Close'].pct_change(1)
BFBbef['Cumulative Return Before Crash'] = (1 + BFBbef['avgreturnbefore']).cumprod()
#period of crash
BFBdur = web.DataReader('BF-B', 'yahoo', crashstart, crashend)
BFBdur['avgreturnduring'] = BFBdur['Close'].pct_change(1)
BFBdur['Cumulative Return During Crash'] = (1 + BFBdur['avgreturnduring']).cumprod()
#period after crash
BFBaft = web.DataReader('BF-B', 'yahoo', crashend, end)
BFBaft['avgreturnafter'] = BFBaft['Close'].pct_change(1)
BFBaft['Cumulative Return After Crash'] = (1 + BFBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CPB = web.DataReader('CPB', 'yahoo', start, end)
CPB['returns'] = CPB['Close'].pct_change(1)
CPB['Cumulative Return'] = (1 + CPB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CPBmean = CPB['returns'].mean()
CPBvar = CPB['returns'].var()
CPBkurt = CPB['returns'].kurt()
CPBskew = CPB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CPBbef = web.DataReader('CPB', 'yahoo', start, crashstart)
CPBbef['avgreturnbefore'] = CPBbef['Close'].pct_change(1)
CPBbef['Cumulative Return Before Crash'] = (1 + CPBbef['avgreturnbefore']).cumprod()
#period of crash
CPBdur = web.DataReader('CPB', 'yahoo', crashstart, crashend)
CPBdur['avgreturnduring'] = CPBdur['Close'].pct_change(1)
CPBdur['Cumulative Return During Crash'] = (1 + CPBdur['avgreturnduring']).cumprod()
#period after crash
CPBaft = web.DataReader('CPB', 'yahoo', crashend, end)
CPBaft['avgreturnafter'] = CPBaft['Close'].pct_change(1)
CPBaft['Cumulative Return After Crash'] = (1 + CPBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CHD = web.DataReader('CHD', 'yahoo', start, end)
CHD['returns'] = CHD['Close'].pct_change(1)
CHD['Cumulative Return'] = (1 + CHD['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CHDmean = CHD['returns'].mean()
CHDvar = CHD['returns'].var()
CHDkurt = CHD['returns'].kurt()
CHDskew = CHD['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CHDbef = web.DataReader('CHD', 'yahoo', start, crashstart)
CHDbef['avgreturnbefore'] = CHDbef['Close'].pct_change(1)
CHDbef['Cumulative Return Before Crash'] = (1 + CHDbef['avgreturnbefore']).cumprod()
#period of crash
CHDdur = web.DataReader('CHD', 'yahoo', crashstart, crashend)
CHDdur['avgreturnduring'] = CHDdur['Close'].pct_change(1)
CHDdur['Cumulative Return During Crash'] = (1 + CHDdur['avgreturnduring']).cumprod()
#period after crash
CHDaft = web.DataReader('CHD', 'yahoo', crashend, end)
CHDaft['avgreturnafter'] = CHDaft['Close'].pct_change(1)
CHDaft['Cumulative Return After Crash'] = (1 + CHDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CLX = web.DataReader('CLX', 'yahoo', start, end)
CLX['returns'] = CLX['Close'].pct_change(1)
CLX['Cumulative Return'] = (1 + CLX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CLXmean = CLX['returns'].mean()
CLXvar = CLX['returns'].var()
CLXkurt = CLX['returns'].kurt()
CLXskew = CLX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CLXbef = web.DataReader('CLX', 'yahoo', start, crashstart)
CLXbef['avgreturnbefore'] = CLXbef['Close'].pct_change(1)
CLXbef['Cumulative Return Before Crash'] = (1 + CLXbef['avgreturnbefore']).cumprod()
#period of crash
CLXdur = web.DataReader('CLX', 'yahoo', crashstart, crashend)
CLXdur['avgreturnduring'] = CLXdur['Close'].pct_change(1)
CLXdur['Cumulative Return During Crash'] = (1 + CLXdur['avgreturnduring']).cumprod()
#period after crash
CLXaft = web.DataReader('CLX', 'yahoo', crashend, end)
CLXaft['avgreturnafter'] = CLXaft['Close'].pct_change(1)
CLXaft['Cumulative Return After Crash'] = (1 + CLXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
KO = web.DataReader('KO', 'yahoo', start, end)
KO['returns'] = KO['Close'].pct_change(1)
KO['Cumulative Return'] = (1 + KO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
KOmean = KO['returns'].mean()
KOvar = KO['returns'].var()
KOkurt = KO['returns'].kurt()
KOskew = KO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
KObef = web.DataReader('KO', 'yahoo', start, crashstart)
KObef['avgreturnbefore'] = KObef['Close'].pct_change(1)
KObef['Cumulative Return Before Crash'] = (1 + KObef['avgreturnbefore']).cumprod()
#period of crash
KOdur = web.DataReader('KO', 'yahoo', crashstart, crashend)
KOdur['avgreturnduring'] = KOdur['Close'].pct_change(1)
KOdur['Cumulative Return During Crash'] = (1 + KOdur['avgreturnduring']).cumprod()
#period after crash
KOaft = web.DataReader('KO', 'yahoo', crashend, end)
KOaft['avgreturnafter'] = KOaft['Close'].pct_change(1)
KOaft['Cumulative Return After Crash'] = (1 + KOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CL = web.DataReader('CL', 'yahoo', start, end)
CL['returns'] = CL['Close'].pct_change(1)
CL['Cumulative Return'] = (1 + CL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CLmean = CL['returns'].mean()
CLvar = CL['returns'].var()
CLkurt = CL['returns'].kurt()
CLskew = CL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CLbef = web.DataReader('CL', 'yahoo', start, crashstart)
CLbef['avgreturnbefore'] = CLbef['Close'].pct_change(1)
CLbef['Cumulative Return Before Crash'] = (1 + CLbef['avgreturnbefore']).cumprod()
#period of crash
CLdur = web.DataReader('CL', 'yahoo', crashstart, crashend)
CLdur['avgreturnduring'] = CLdur['Close'].pct_change(1)
CLdur['Cumulative Return During Crash'] = (1 + CLdur['avgreturnduring']).cumprod()
#period after crash
CLaft = web.DataReader('CL', 'yahoo', crashend, end)
CLaft['avgreturnafter'] = CLaft['Close'].pct_change(1)
CLaft['Cumulative Return After Crash'] = (1 + CLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CAG = web.DataReader('CAG', 'yahoo', start, end)
CAG['returns'] = CAG['Close'].pct_change(1)
CAG['Cumulative Return'] = (1 + CAG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CAGmean = CAG['returns'].mean()
CAGvar = CAG['returns'].var()
CAGkurt = CAG['returns'].kurt()
CAGskew = CAG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CAGbef = web.DataReader('CAG', 'yahoo', start, crashstart)
CAGbef['avgreturnbefore'] = CAGbef['Close'].pct_change(1)
CAGbef['Cumulative Return Before Crash'] = (1 + CAGbef['avgreturnbefore']).cumprod()
#period of crash
CAGdur = web.DataReader('CAG', 'yahoo', crashstart, crashend)
CAGdur['avgreturnduring'] = CAGdur['Close'].pct_change(1)
CAGdur['Cumulative Return During Crash'] = (1 + CAGdur['avgreturnduring']).cumprod()
#period after crash
CAGaft = web.DataReader('CAG', 'yahoo', crashend, end)
CAGaft['avgreturnafter'] = CAGaft['Close'].pct_change(1)
CAGaft['Cumulative Return After Crash'] = (1 + CAGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
STZ = web.DataReader('STZ', 'yahoo', start, end)
STZ['returns'] = STZ['Close'].pct_change(1)
STZ['Cumulative Return'] = (1 + STZ['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
STZmean = STZ['returns'].mean()
STZvar = STZ['returns'].var()
STZkurt = STZ['returns'].kurt()
STZskew = STZ['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
STZbef = web.DataReader('STZ', 'yahoo', start, crashstart)
STZbef['avgreturnbefore'] = STZbef['Close'].pct_change(1)
STZbef['Cumulative Return Before Crash'] = (1 + STZbef['avgreturnbefore']).cumprod()
#period of crash
STZdur = web.DataReader('STZ', 'yahoo', crashstart, crashend)
STZdur['avgreturnduring'] = STZdur['Close'].pct_change(1)
STZdur['Cumulative Return During Crash'] = (1 + STZdur['avgreturnduring']).cumprod()
#period after crash
STZaft = web.DataReader('STZ', 'yahoo', crashend, end)
STZaft['avgreturnafter'] = STZaft['Close'].pct_change(1)
STZaft['Cumulative Return After Crash'] = (1 + STZaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
COST = web.DataReader('COST', 'yahoo', start, end)
COST['returns'] = COST['Close'].pct_change(1)
COST['Cumulative Return'] = (1 + COST['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
COSTmean = COST['returns'].mean()
COSTvar = COST['returns'].var()
COSTkurt = COST['returns'].kurt()
COSTskew = COST['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
COSTbef = web.DataReader('COST', 'yahoo', start, crashstart)
COSTbef['avgreturnbefore'] = COSTbef['Close'].pct_change(1)
COSTbef['Cumulative Return Before Crash'] = (1 + COSTbef['avgreturnbefore']).cumprod()
#period of crash
COSTdur = web.DataReader('COST', 'yahoo', crashstart, crashend)
COSTdur['avgreturnduring'] = COSTdur['Close'].pct_change(1)
COSTdur['Cumulative Return During Crash'] = (1 + COSTdur['avgreturnduring']).cumprod()
#period after crash
COSTaft = web.DataReader('COST', 'yahoo', crashend, end)
COSTaft['avgreturnafter'] = COSTaft['Close'].pct_change(1)
COSTaft['Cumulative Return After Crash'] = (1 + COSTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
COTY = web.DataReader('COTY', 'yahoo', start, end)
COTY['returns'] = COTY['Close'].pct_change(1)
COTY['Cumulative Return'] = (1 + COTY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
COTYmean = COTY['returns'].mean()
COTYvar = COTY['returns'].var()
COTYkurt = COTY['returns'].kurt()
COTYskew = COTY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
COTYbef = web.DataReader('COTY', 'yahoo', start, crashstart)
COTYbef['avgreturnbefore'] = COTYbef['Close'].pct_change(1)
COTYbef['Cumulative Return Before Crash'] = (1 + COTYbef['avgreturnbefore']).cumprod()
#period of crash
COTYdur = web.DataReader('COTY', 'yahoo', crashstart, crashend)
COTYdur['avgreturnduring'] = COTYdur['Close'].pct_change(1)
COTYdur['Cumulative Return During Crash'] = (1 + COTYdur['avgreturnduring']).cumprod()
#period after crash
COTYaft = web.DataReader('COTY', 'yahoo', crashend, end)
COTYaft['avgreturnafter'] = COTYaft['Close'].pct_change(1)
COTYaft['Cumulative Return After Crash'] = (1 + COTYaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EL = web.DataReader('EL', 'yahoo', start, end)
EL['returns'] = EL['Close'].pct_change(1)
EL['Cumulative Return'] = (1 + EL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ELmean = EL['returns'].mean()
ELvar = EL['returns'].var()
ELkurt = EL['returns'].kurt()
ELskew = EL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ELbef = web.DataReader('EL', 'yahoo', start, crashstart)
ELbef['avgreturnbefore'] = ELbef['Close'].pct_change(1)
ELbef['Cumulative Return Before Crash'] = (1 + ELbef['avgreturnbefore']).cumprod()
#period of crash
ELdur = web.DataReader('EL', 'yahoo', crashstart, crashend)
ELdur['avgreturnduring'] = ELdur['Close'].pct_change(1)
ELdur['Cumulative Return During Crash'] = (1 + ELdur['avgreturnduring']).cumprod()
#period after crash
ELaft = web.DataReader('EL', 'yahoo', crashend, end)
ELaft['avgreturnafter'] = ELaft['Close'].pct_change(1)
ELaft['Cumulative Return After Crash'] = (1 + ELaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GIS = web.DataReader('GIS', 'yahoo', start, end)
GIS['returns'] = GIS['Close'].pct_change(1)
GIS['Cumulative Return'] = (1 + GIS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GISmean = GIS['returns'].mean()
GISvar = GIS['returns'].var()
GISkurt = GIS['returns'].kurt()
GISskew = GIS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GISbef = web.DataReader('GIS', 'yahoo', start, crashstart)
GISbef['avgreturnbefore'] = GISbef['Close'].pct_change(1)
GISbef['Cumulative Return Before Crash'] = (1 + GISbef['avgreturnbefore']).cumprod()
#period of crash
GISdur = web.DataReader('GIS', 'yahoo', crashstart, crashend)
GISdur['avgreturnduring'] = GISdur['Close'].pct_change(1)
GISdur['Cumulative Return During Crash'] = (1 + GISdur['avgreturnduring']).cumprod()
#period after crash
GISaft = web.DataReader('GIS', 'yahoo', crashend, end)
GISaft['avgreturnafter'] = GISaft['Close'].pct_change(1)
GISaft['Cumulative Return After Crash'] = (1 + GISaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HSY = web.DataReader('HSY', 'yahoo', start, end)
HSY['returns'] = HSY['Close'].pct_change(1)
HSY['Cumulative Return'] = (1 + HSY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HSYmean = HSY['returns'].mean()
HSYvar = HSY['returns'].var()
HSYkurt = HSY['returns'].kurt()
HSYskew = HSY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HSYbef = web.DataReader('HSY', 'yahoo', start, crashstart)
HSYbef['avgreturnbefore'] = HSYbef['Close'].pct_change(1)
HSYbef['Cumulative Return Before Crash'] = (1 + HSYbef['avgreturnbefore']).cumprod()
#period of crash
HSYdur = web.DataReader('HSY', 'yahoo', crashstart, crashend)
HSYdur['avgreturnduring'] = HSYdur['Close'].pct_change(1)
HSYdur['Cumulative Return During Crash'] = (1 + HSYdur['avgreturnduring']).cumprod()
#period after crash
HSYaft = web.DataReader('HSY', 'yahoo', crashend, end)
HSYaft['avgreturnafter'] = HSYaft['Close'].pct_change(1)
HSYaft['Cumulative Return After Crash'] = (1 + HSYaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HRL = web.DataReader('HRL', 'yahoo', start, end)
HRL['returns'] = HRL['Close'].pct_change(1)
HRL['Cumulative Return'] = (1 + HRL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HRLmean = HRL['returns'].mean()
HRLvar = HRL['returns'].var()
HRLkurt = HRL['returns'].kurt()
HRLskew = HRL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HRLbef = web.DataReader('HRL', 'yahoo', start, crashstart)
HRLbef['avgreturnbefore'] = HRLbef['Close'].pct_change(1)
HRLbef['Cumulative Return Before Crash'] = (1 + HRLbef['avgreturnbefore']).cumprod()
#period of crash
HRLdur = web.DataReader('HRL', 'yahoo', crashstart, crashend)
HRLdur['avgreturnduring'] = HRLdur['Close'].pct_change(1)
HRLdur['Cumulative Return During Crash'] = (1 + HRLdur['avgreturnduring']).cumprod()
#period after crash
HRLaft = web.DataReader('HRL', 'yahoo', crashend, end)
HRLaft['avgreturnafter'] = HRLaft['Close'].pct_change(1)
HRLaft['Cumulative Return After Crash'] = (1 + HRLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SJM = web.DataReader('SJM', 'yahoo', start, end)
SJM['returns'] = SJM['Close'].pct_change(1)
SJM['Cumulative Return'] = (1 + SJM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SJMmean = SJM['returns'].mean()
SJMvar = SJM['returns'].var()
SJMkurt = SJM['returns'].kurt()
SJMskew = SJM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SJMbef = web.DataReader('SJM', 'yahoo', start, crashstart)
SJMbef['avgreturnbefore'] = SJMbef['Close'].pct_change(1)
SJMbef['Cumulative Return Before Crash'] = (1 + SJMbef['avgreturnbefore']).cumprod()
#period of crash
SJMdur = web.DataReader('SJM', 'yahoo', crashstart, crashend)
SJMdur['avgreturnduring'] = SJMdur['Close'].pct_change(1)
SJMdur['Cumulative Return During Crash'] = (1 + SJMdur['avgreturnduring']).cumprod()
#period after crash
SJMaft = web.DataReader('SJM', 'yahoo', crashend, end)
SJMaft['avgreturnafter'] = SJMaft['Close'].pct_change(1)
SJMaft['Cumulative Return After Crash'] = (1 + SJMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
K = web.DataReader('K', 'yahoo', start, end)
K['returns'] = K['Close'].pct_change(1)
K['Cumulative Return'] = (1 + K['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
Kmean = K['returns'].mean()
Kvar = K['returns'].var()
Kkurt = K['returns'].kurt()
Kskew = K['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
Kbef = web.DataReader('K', 'yahoo', start, crashstart)
Kbef['avgreturnbefore'] = Kbef['Close'].pct_change(1)
Kbef['Cumulative Return Before Crash'] = (1 + Kbef['avgreturnbefore']).cumprod()
#period of crash
Kdur = web.DataReader('K', 'yahoo', crashstart, crashend)
Kdur['avgreturnduring'] = Kdur['Close'].pct_change(1)
Kdur['Cumulative Return During Crash'] = (1 + Kdur['avgreturnduring']).cumprod()
#period after crash
Kaft = web.DataReader('K', 'yahoo', crashend, end)
Kaft['avgreturnafter'] = Kaft['Close'].pct_change(1)
Kaft['Cumulative Return After Crash'] = (1 + Kaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
KMB = web.DataReader('KMB', 'yahoo', start, end)
KMB['returns'] = KMB['Close'].pct_change(1)
KMB['Cumulative Return'] = (1 + KMB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
KMBmean = KMB['returns'].mean()
KMBvar = KMB['returns'].var()
KMBkurt = KMB['returns'].kurt()
KMBskew = KMB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
KMBbef = web.DataReader('KMB', 'yahoo', start, crashstart)
KMBbef['avgreturnbefore'] = KMBbef['Close'].pct_change(1)
KMBbef['Cumulative Return Before Crash'] = (1 + KMBbef['avgreturnbefore']).cumprod()
#period of crash
KMBdur = web.DataReader('KMB', 'yahoo', crashstart, crashend)
KMBdur['avgreturnduring'] = KMBdur['Close'].pct_change(1)
KMBdur['Cumulative Return During Crash'] = (1 + KMBdur['avgreturnduring']).cumprod()
#period after crash
KMBaft = web.DataReader('KMB', 'yahoo', crashend, end)
KMBaft['avgreturnafter'] = KMBaft['Close'].pct_change(1)
KMBaft['Cumulative Return After Crash'] = (1 + KMBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
KHC = web.DataReader('KHC', 'yahoo', start, end)
KHC['returns'] = KHC['Close'].pct_change(1)
KHC['Cumulative Return'] = (1 + KHC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
KHCmean = KHC['returns'].mean()
KHCvar = KHC['returns'].var()
KHCkurt = KHC['returns'].kurt()
KHCskew = KHC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
KHCbef = web.DataReader('KHC', 'yahoo', start, crashstart)
KHCbef['avgreturnbefore'] = KHCbef['Close'].pct_change(1)
KHCbef['Cumulative Return Before Crash'] = (1 + KHCbef['avgreturnbefore']).cumprod()
#period of crash
KHCdur = web.DataReader('KHC', 'yahoo', crashstart, crashend)
KHCdur['avgreturnduring'] = KHCdur['Close'].pct_change(1)
KHCdur['Cumulative Return During Crash'] = (1 + KHCdur['avgreturnduring']).cumprod()
#period after crash
KHCaft = web.DataReader('KHC', 'yahoo', crashend, end)
KHCaft['avgreturnafter'] = KHCaft['Close'].pct_change(1)
KHCaft['Cumulative Return After Crash'] = (1 + KHCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
KR = web.DataReader('KR', 'yahoo', start, end)
KR['returns'] = KR['Close'].pct_change(1)
KR['Cumulative Return'] = (1 + KR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
KRmean = KR['returns'].mean()
KRvar = KR['returns'].var()
KRkurt = KR['returns'].kurt()
KRskew = KR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
KRbef = web.DataReader('KR', 'yahoo', start, crashstart)
KRbef['avgreturnbefore'] = KRbef['Close'].pct_change(1)
KRbef['Cumulative Return Before Crash'] = (1 + KRbef['avgreturnbefore']).cumprod()
#period of crash
KRdur = web.DataReader('KR', 'yahoo', crashstart, crashend)
KRdur['avgreturnduring'] = KRdur['Close'].pct_change(1)
KRdur['Cumulative Return During Crash'] = (1 + KRdur['avgreturnduring']).cumprod()
#period after crash
KRaft = web.DataReader('KR', 'yahoo', crashend, end)
KRaft['avgreturnafter'] = KRaft['Close'].pct_change(1)
KRaft['Cumulative Return After Crash'] = (1 + KRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LW = web.DataReader('LW', 'yahoo', start, end)
LW['returns'] = LW['Close'].pct_change(1)
LW['Cumulative Return'] = (1 + LW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LWmean = LW['returns'].mean()
LWvar = LW['returns'].var()
LWkurt = LW['returns'].kurt()
LWskew = LW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LWbef = web.DataReader('LW', 'yahoo', start, crashstart)
LWbef['avgreturnbefore'] = LWbef['Close'].pct_change(1)
LWbef['Cumulative Return Before Crash'] = (1 + LWbef['avgreturnbefore']).cumprod()
#period of crash
LWdur = web.DataReader('LW', 'yahoo', crashstart, crashend)
LWdur['avgreturnduring'] = LWdur['Close'].pct_change(1)
LWdur['Cumulative Return During Crash'] = (1 + LWdur['avgreturnduring']).cumprod()
#period after crash
LWaft = web.DataReader('LW', 'yahoo', crashend, end)
LWaft['avgreturnafter'] = LWaft['Close'].pct_change(1)
LWaft['Cumulative Return After Crash'] = (1 + LWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MKC = web.DataReader('MKC', 'yahoo', start, end)
MKC['returns'] = MKC['Close'].pct_change(1)
MKC['Cumulative Return'] = (1 + MKC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MKCmean = MKC['returns'].mean()
MKCvar = MKC['returns'].var()
MKCkurt = MKC['returns'].kurt()
MKCskew = MKC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MKCbef = web.DataReader('MKC', 'yahoo', start, crashstart)
MKCbef['avgreturnbefore'] = MKCbef['Close'].pct_change(1)
MKCbef['Cumulative Return Before Crash'] = (1 + MKCbef['avgreturnbefore']).cumprod()
#period of crash
MKCdur = web.DataReader('MKC', 'yahoo', crashstart, crashend)
MKCdur['avgreturnduring'] = MKCdur['Close'].pct_change(1)
MKCdur['Cumulative Return During Crash'] = (1 + MKCdur['avgreturnduring']).cumprod()
#period after crash
MKCaft = web.DataReader('MKC', 'yahoo', crashend, end)
MKCaft['avgreturnafter'] = MKCaft['Close'].pct_change(1)
MKCaft['Cumulative Return After Crash'] = (1 + MKCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TAP = web.DataReader('TAP', 'yahoo', start, end)
TAP['returns'] = TAP['Close'].pct_change(1)
TAP['Cumulative Return'] = (1 + TAP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TAPmean = TAP['returns'].mean()
TAPvar = TAP['returns'].var()
TAPkurt = TAP['returns'].kurt()
TAPskew = TAP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TAPbef = web.DataReader('TAP', 'yahoo', start, crashstart)
TAPbef['avgreturnbefore'] = TAPbef['Close'].pct_change(1)
TAPbef['Cumulative Return Before Crash'] = (1 + TAPbef['avgreturnbefore']).cumprod()
#period of crash
TAPdur = web.DataReader('TAP', 'yahoo', crashstart, crashend)
TAPdur['avgreturnduring'] = TAPdur['Close'].pct_change(1)
TAPdur['Cumulative Return During Crash'] = (1 + TAPdur['avgreturnduring']).cumprod()
#period after crash
TAPaft = web.DataReader('TAP', 'yahoo', crashend, end)
TAPaft['avgreturnafter'] = TAPaft['Close'].pct_change(1)
TAPaft['Cumulative Return After Crash'] = (1 + TAPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MDLZ = web.DataReader('MDLZ', 'yahoo', start, end)
MDLZ['returns'] = MDLZ['Close'].pct_change(1)
MDLZ['Cumulative Return'] = (1 + MDLZ['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MDLZmean = MDLZ['returns'].mean()
MDLZvar = MDLZ['returns'].var()
MDLZkurt = MDLZ['returns'].kurt()
MDLZskew = MDLZ['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MDLZbef = web.DataReader('MDLZ', 'yahoo', start, crashstart)
MDLZbef['avgreturnbefore'] = MDLZbef['Close'].pct_change(1)
MDLZbef['Cumulative Return Before Crash'] = (1 + MDLZbef['avgreturnbefore']).cumprod()
#period of crash
MDLZdur = web.DataReader('MDLZ', 'yahoo', crashstart, crashend)
MDLZdur['avgreturnduring'] = MDLZdur['Close'].pct_change(1)
MDLZdur['Cumulative Return During Crash'] = (1 + MDLZdur['avgreturnduring']).cumprod()
#period after crash
MDLZaft = web.DataReader('MDLZ', 'yahoo', crashend, end)
MDLZaft['avgreturnafter'] = MDLZaft['Close'].pct_change(1)
MDLZaft['Cumulative Return After Crash'] = (1 + MDLZaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MNST = web.DataReader('MNST', 'yahoo', start, end)
MNST['returns'] = MNST['Close'].pct_change(1)
MNST['Cumulative Return'] = (1 + MNST['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MNSTmean = MNST['returns'].mean()
MNSTvar = MNST['returns'].var()
MNSTkurt = MNST['returns'].kurt()
MNSTskew = MNST['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MNSTbef = web.DataReader('MNST', 'yahoo', start, crashstart)
MNSTbef['avgreturnbefore'] = MNSTbef['Close'].pct_change(1)
MNSTbef['Cumulative Return Before Crash'] = (1 + MNSTbef['avgreturnbefore']).cumprod()
#period of crash
MNSTdur = web.DataReader('MNST', 'yahoo', crashstart, crashend)
MNSTdur['avgreturnduring'] = MNSTdur['Close'].pct_change(1)
MNSTdur['Cumulative Return During Crash'] = (1 + MNSTdur['avgreturnduring']).cumprod()
#period after crash
MNSTaft = web.DataReader('MNST', 'yahoo', crashend, end)
MNSTaft['avgreturnafter'] = MNSTaft['Close'].pct_change(1)
MNSTaft['Cumulative Return After Crash'] = (1 + MNSTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PEP = web.DataReader('PEP', 'yahoo', start, end)
PEP['returns'] = PEP['Close'].pct_change(1)
PEP['Cumulative Return'] = (1 + PEP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PEPmean = PEP['returns'].mean()
PEPvar = PEP['returns'].var()
PEPkurt = PEP['returns'].kurt()
PEPskew = PEP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PEPbef = web.DataReader('PEP', 'yahoo', start, crashstart)
PEPbef['avgreturnbefore'] = PEPbef['Close'].pct_change(1)
PEPbef['Cumulative Return Before Crash'] = (1 + PEPbef['avgreturnbefore']).cumprod()
#period of crash
PEPdur = web.DataReader('PEP', 'yahoo', crashstart, crashend)
PEPdur['avgreturnduring'] = PEPdur['Close'].pct_change(1)
PEPdur['Cumulative Return During Crash'] = (1 + PEPdur['avgreturnduring']).cumprod()
#period after crash
PEPaft = web.DataReader('PEP', 'yahoo', crashend, end)
PEPaft['avgreturnafter'] = PEPaft['Close'].pct_change(1)
PEPaft['Cumulative Return After Crash'] = (1 + PEPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PM = web.DataReader('PM', 'yahoo', start, end)
PM['returns'] = PM['Close'].pct_change(1)
PM['Cumulative Return'] = (1 + PM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PMmean = PM['returns'].mean()
PMvar = PM['returns'].var()
PMkurt = PM['returns'].kurt()
PMskew = PM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PMbef = web.DataReader('PM', 'yahoo', start, crashstart)
PMbef['avgreturnbefore'] = PMbef['Close'].pct_change(1)
PMbef['Cumulative Return Before Crash'] = (1 + PMbef['avgreturnbefore']).cumprod()
#period of crash
PMdur = web.DataReader('PM', 'yahoo', crashstart, crashend)
PMdur['avgreturnduring'] = PMdur['Close'].pct_change(1)
PMdur['Cumulative Return During Crash'] = (1 + PMdur['avgreturnduring']).cumprod()
#period after crash
PMaft = web.DataReader('PM', 'yahoo', crashend, end)
PMaft['avgreturnafter'] = PMaft['Close'].pct_change(1)
PMaft['Cumulative Return After Crash'] = (1 + PMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PG = web.DataReader('PG', 'yahoo', start, end)
PG['returns'] = PG['Close'].pct_change(1)
PG['Cumulative Return'] = (1 + PG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PGmean = PG['returns'].mean()
PGvar = PG['returns'].var()
PGkurt = PG['returns'].kurt()
PGskew = PG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PGbef = web.DataReader('PG', 'yahoo', start, crashstart)
PGbef['avgreturnbefore'] = PGbef['Close'].pct_change(1)
PGbef['Cumulative Return Before Crash'] = (1 + PGbef['avgreturnbefore']).cumprod()
#period of crash
PGdur = web.DataReader('PG', 'yahoo', crashstart, crashend)
PGdur['avgreturnduring'] = PGdur['Close'].pct_change(1)
PGdur['Cumulative Return During Crash'] = (1 + PGdur['avgreturnduring']).cumprod()
#period after crash
PGaft = web.DataReader('PG', 'yahoo', crashend, end)
PGaft['avgreturnafter'] = PGaft['Close'].pct_change(1)
PGaft['Cumulative Return After Crash'] = (1 + PGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SYY = web.DataReader('SYY', 'yahoo', start, end)
SYY['returns'] = SYY['Close'].pct_change(1)
SYY['Cumulative Return'] = (1 + SYY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SYYmean = SYY['returns'].mean()
SYYvar = SYY['returns'].var()
SYYkurt = SYY['returns'].kurt()
SYYskew = SYY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SYYbef = web.DataReader('SYY', 'yahoo', start, crashstart)
SYYbef['avgreturnbefore'] = SYYbef['Close'].pct_change(1)
SYYbef['Cumulative Return Before Crash'] = (1 + SYYbef['avgreturnbefore']).cumprod()
#period of crash
SYYdur = web.DataReader('SYY', 'yahoo', crashstart, crashend)
SYYdur['avgreturnduring'] = SYYdur['Close'].pct_change(1)
SYYdur['Cumulative Return During Crash'] = (1 + SYYdur['avgreturnduring']).cumprod()
#period after crash
SYYaft = web.DataReader('SYY', 'yahoo', crashend, end)
SYYaft['avgreturnafter'] = SYYaft['Close'].pct_change(1)
SYYaft['Cumulative Return After Crash'] = (1 + SYYaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TSN = web.DataReader('TSN', 'yahoo', start, end)
TSN['returns'] = TSN['Close'].pct_change(1)
TSN['Cumulative Return'] = (1 + TSN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TSNmean = TSN['returns'].mean()
TSNvar = TSN['returns'].var()
TSNkurt = TSN['returns'].kurt()
TSNskew = TSN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TSNbef = web.DataReader('TSN', 'yahoo', start, crashstart)
TSNbef['avgreturnbefore'] = TSNbef['Close'].pct_change(1)
TSNbef['Cumulative Return Before Crash'] = (1 + TSNbef['avgreturnbefore']).cumprod()
#period of crash
TSNdur = web.DataReader('TSN', 'yahoo', crashstart, crashend)
TSNdur['avgreturnduring'] = TSNdur['Close'].pct_change(1)
TSNdur['Cumulative Return During Crash'] = (1 + TSNdur['avgreturnduring']).cumprod()
#period after crash
TSNaft = web.DataReader('TSN', 'yahoo', crashend, end)
TSNaft['avgreturnafter'] = TSNaft['Close'].pct_change(1)
TSNaft['Cumulative Return After Crash'] = (1 + TSNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WMT = web.DataReader('WMT', 'yahoo', start, end)
WMT['returns'] = WMT['Close'].pct_change(1)
WMT['Cumulative Return'] = (1 + WMT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WMTmean = WMT['returns'].mean()
WMTvar = WMT['returns'].var()
WMTkurt = WMT['returns'].kurt()
WMTskew = WMT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WMTbef = web.DataReader('WMT', 'yahoo', start, crashstart)
WMTbef['avgreturnbefore'] = WMTbef['Close'].pct_change(1)
WMTbef['Cumulative Return Before Crash'] = (1 + WMTbef['avgreturnbefore']).cumprod()
#period of crash
WMTdur = web.DataReader('WMT', 'yahoo', crashstart, crashend)
WMTdur['avgreturnduring'] = WMTdur['Close'].pct_change(1)
WMTdur['Cumulative Return During Crash'] = (1 + WMTdur['avgreturnduring']).cumprod()
#period after crash
WMTaft = web.DataReader('WMT', 'yahoo', crashend, end)
WMTaft['avgreturnafter'] = WMTaft['Close'].pct_change(1)
WMTaft['Cumulative Return After Crash'] = (1 + WMTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WBA = web.DataReader('WBA', 'yahoo', start, end)
WBA['returns'] = WBA['Close'].pct_change(1)
WBA['Cumulative Return'] = (1 + WBA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WBAmean = WBA['returns'].mean()
WBAvar = WBA['returns'].var()
WBAkurt = WBA['returns'].kurt()
WBAskew = WBA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WBAbef = web.DataReader('WBA', 'yahoo', start, crashstart)
WBAbef['avgreturnbefore'] = WBAbef['Close'].pct_change(1)
WBAbef['Cumulative Return Before Crash'] = (1 + WBAbef['avgreturnbefore']).cumprod()
#period of crash
WBAdur = web.DataReader('WBA', 'yahoo', crashstart, crashend)
WBAdur['avgreturnduring'] = WBAdur['Close'].pct_change(1)
WBAdur['Cumulative Return During Crash'] = (1 + WBAdur['avgreturnduring']).cumprod()
#period after crash
WBAaft = web.DataReader('WBA', 'yahoo', crashend, end)
WBAaft['avgreturnafter'] = WBAaft['Close'].pct_change(1)
WBAaft['Cumulative Return After Crash'] = (1 + WBAaft['avgreturnafter']).cumprod()
#KDE Plot for Consumer Staples Sector
sp['returns'].plot(kind = 'kde', label ='S&P 500', alpha=0.5)
MO['returns'].plot(kind = 'kde', label ='MO', figsize = (10,8), alpha=0.5, title = 'KDE of Consumer Staples Stocks')
ADM['returns'].plot(kind = 'kde', label ='ADM', alpha=0.5)
BFB['returns'].plot(kind = 'kde', label ='BF.B', alpha=0.5)
CPB['returns'].plot(kind = 'kde', label ='CPB', alpha=0.5)
CHD['returns'].plot(kind = 'kde', label ='CHD', alpha=0.5)
CLX['returns'].plot(kind = 'kde', label ='CLX', alpha=0.5)
KO['returns'].plot(kind = 'kde', label ='KO', alpha=0.5)
CL['returns'].plot(kind = 'kde', label ='CL', alpha=0.5)
CAG['returns'].plot(kind = 'kde', label ='CAG', alpha=0.5)
STZ['returns'].plot(kind = 'kde', label ='STZ', alpha=0.5)
COST['returns'].plot(kind = 'kde', label ='COST', alpha=0.5)
COTY['returns'].plot(kind = 'kde', label ='COTY', alpha=0.5)
EL['returns'].plot(kind = 'kde', label ='EL', alpha=0.5)
GIS['returns'].plot(kind = 'kde', label ='GIS', alpha=0.5)
HSY['returns'].plot(kind = 'kde', label = 'HSY', alpha=0.5)
HRL['returns'].plot(kind = 'kde', label ='HRL', alpha=0.5)
SJM['returns'].plot(kind = 'kde', label ='SJM', alpha=0.5)
K['returns'].plot(kind = 'kde', label ='K', alpha=0.5)
KMB['returns'].plot(kind = 'kde', label ='KMB', alpha=0.5)
KHC['returns'].plot(kind = 'kde', label ='KHC', alpha=0.5)
KR['returns'].plot(kind = 'kde', label ='KR', alpha=0.5)
LW['returns'].plot(kind = 'kde', label ='LW', alpha=0.5)
MKC['returns'].plot(kind = 'kde', label ='MKC', alpha=0.5)
TAP['returns'].plot(kind = 'kde', label ='TAP', alpha=0.5)
MDLZ['returns'].plot(kind = 'kde', label ='MDLZ', alpha=0.5)
MNST['returns'].plot(kind = 'kde', label ='MNST', alpha=0.5)
PEP['returns'].plot(kind = 'kde', label ='PEP', alpha=0.5)
PM['returns'].plot(kind = 'kde', label ='PM', alpha=0.5)
PG['returns'].plot(kind = 'kde', label ='PG', alpha=0.5)
SYY['returns'].plot(kind = 'kde', label ='SYY', alpha=0.5)
TSN['returns'].plot(kind = 'kde', label ='TSN', alpha=0.5)
WMT['returns'].plot(kind = 'kde', label ='WMT', alpha=0.5)
WBA['returns'].plot(kind = 'kde', label ='WBA', alpha=0.5)
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Boxplots comparing returns for Consumer Staples Sector
box_df = pd.concat([sp['returns'],MO['returns'],ADM['returns'],BFB['returns'],CPB['returns'],CHD['returns'],CLX['returns'],KO['returns'],CL['returns'],CAG['returns'],STZ['returns'],COST['returns'],COTY['returns'],EL['returns'],GIS['returns'],HSY['returns'],HRL['returns'],SJM['returns'],K['returns'],KMB['returns'],KHC['returns'],KR['returns'],LW['returns'],MKC['returns'],TAP['returns'],MDLZ['returns'],MNST['returns'],PEP['returns'],PM['returns'],PG['returns'],SYY['returns'],TSN['returns'],WMT['returns'],WBA['returns']], axis=1)
box_df.columns = ['S&P 500','MO','ADM','BF.B','CPB','CHD','CLX','KO','CL','CAG','STZ','COST','COTY','EL','GIS','HSY','HRL','SJM','K','KMB','KHC','KR','LW','MKC','TAP','MDLZ','MNST','PEP','PM','PG','SYY','TSN','WMT','WBA']
box_df.plot(kind='box', figsize=(30,10), colormap= 'jet', title = 'Boxplots of Consumer Staples Sector Returns')
#Cumulative Returns of Consumer Staples Stocks for Whole period
sp['Cumulative Return'].plot(label="S&P 500")
MO['Cumulative Return'].plot(label='MO', figsize=(16,8), title = 'Cumulative Return of Consumer Staples Stocks')
ADM['Cumulative Return'].plot(label="ADM")
BFB['Cumulative Return'].plot(label="BF.B")
CPB['Cumulative Return'].plot(label="CPB")
CHD['Cumulative Return'].plot(label="CHD")
CLX['Cumulative Return'].plot(label="CLX")
KO['Cumulative Return'].plot(label="KO")
CL['Cumulative Return'].plot(label="CL")
CAG['Cumulative Return'].plot(label="CAG")
STZ['Cumulative Return'].plot(label="STZ")
COST['Cumulative Return'].plot(label="COST")
COTY['Cumulative Return'].plot(label="COTY")
EL['Cumulative Return'].plot(label="EL")
GIS['Cumulative Return'].plot(label="GIS")
HSY['Cumulative Return'].plot(label="HSY")
HRL['Cumulative Return'].plot(label="HRL")
SJM['Cumulative Return'].plot(label="SJM")
K['Cumulative Return'].plot(label="K")
KMB['Cumulative Return'].plot(label="KMB")
KHC['Cumulative Return'].plot(label="KHC")
KR['Cumulative Return'].plot(label="KR")
LW['Cumulative Return'].plot(label="LW")
MKC['Cumulative Return'].plot(label="MKC")
TAP['Cumulative Return'].plot(label="TAP")
MDLZ['Cumulative Return'].plot(label="MDLZ")
MNST['Cumulative Return'].plot(label="MNST")
PEP['Cumulative Return'].plot(label="PEP")
PM['Cumulative Return'].plot(label="PM")
PG['Cumulative Return'].plot(label="PG")
SYY['Cumulative Return'].plot(label="SYY")
TSN['Cumulative Return'].plot(label="TSN")
WMT['Cumulative Return'].plot(label="WMT")
WBA['Cumulative Return'].plot(label="WBA")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Sorting by Cumulative Return
cumret = {'Cumulative Returns 12/4-6/5': [sp['Cumulative Return'].iloc[-1],MO['Cumulative Return'].iloc[-1],ADM['Cumulative Return'].iloc[-1],BFB['Cumulative Return'].iloc[-1],CPB['Cumulative Return'].iloc[-1],CHD['Cumulative Return'].iloc[-1],CLX['Cumulative Return'].iloc[-1],KO['Cumulative Return'].iloc[-1],CL['Cumulative Return'].iloc[-1],CAG['Cumulative Return'].iloc[-1],STZ['Cumulative Return'].iloc[-1],COST['Cumulative Return'].iloc[-1],COTY['Cumulative Return'].iloc[-1],EL['Cumulative Return'].iloc[-1],GIS['Cumulative Return'].iloc[-1],HSY['Cumulative Return'].iloc[-1],HRL['Cumulative Return'].iloc[-1],SJM['Cumulative Return'].iloc[-1],K['Cumulative Return'].iloc[-1],KMB['Cumulative Return'].iloc[-1],KHC['Cumulative Return'].iloc[-1],KR['Cumulative Return'].iloc[-1],LW['Cumulative Return'].iloc[-1],MKC['Cumulative Return'].iloc[-1],TAP['Cumulative Return'].iloc[-1],MDLZ['Cumulative Return'].iloc[-1],MNST['Cumulative Return'].iloc[-1],PEP['Cumulative Return'].iloc[-1],PM['Cumulative Return'].iloc[-1],PG['Cumulative Return'].iloc[-1],SYY['Cumulative Return'].iloc[-1],TSN['Cumulative Return'].iloc[-1],WMT['Cumulative Return'].iloc[-1],WBA['Cumulative Return'].iloc[-1]],
'Cumulative Returns 12/4-2/20': [spbef['Cumulative Return Before Crash'].iloc[-1],MObef['Cumulative Return Before Crash'].iloc[-1],ADMbef['Cumulative Return Before Crash'].iloc[-1],BFBbef['Cumulative Return Before Crash'].iloc[-1],CPBbef['Cumulative Return Before Crash'].iloc[-1],CHDbef['Cumulative Return Before Crash'].iloc[-1],CLXbef['Cumulative Return Before Crash'].iloc[-1],KObef['Cumulative Return Before Crash'].iloc[-1],CLbef['Cumulative Return Before Crash'].iloc[-1],CAGbef['Cumulative Return Before Crash'].iloc[-1],STZbef['Cumulative Return Before Crash'].iloc[-1],COSTbef['Cumulative Return Before Crash'].iloc[-1],COTYbef['Cumulative Return Before Crash'].iloc[-1],ELbef['Cumulative Return Before Crash'].iloc[-1],GISbef['Cumulative Return Before Crash'].iloc[-1],HSYbef['Cumulative Return Before Crash'].iloc[-1],HRLbef['Cumulative Return Before Crash'].iloc[-1],SJMbef['Cumulative Return Before Crash'].iloc[-1],Kbef['Cumulative Return Before Crash'].iloc[-1],KMBbef['Cumulative Return Before Crash'].iloc[-1],KHCbef['Cumulative Return Before Crash'].iloc[-1],KRbef['Cumulative Return Before Crash'].iloc[-1],LWbef['Cumulative Return Before Crash'].iloc[-1],MKCbef['Cumulative Return Before Crash'].iloc[-1],TAPbef['Cumulative Return Before Crash'].iloc[-1],MDLZbef['Cumulative Return Before Crash'].iloc[-1],MNSTbef['Cumulative Return Before Crash'].iloc[-1],PEPbef['Cumulative Return Before Crash'].iloc[-1],PMbef['Cumulative Return Before Crash'].iloc[-1],PGbef['Cumulative Return Before Crash'].iloc[-1],SYYbef['Cumulative Return Before Crash'].iloc[-1],TSNbef['Cumulative Return Before Crash'].iloc[-1],WMTbef['Cumulative Return Before Crash'].iloc[-1],WBAbef['Cumulative Return Before Crash'].iloc[-1]],
'Cumulative Returns 2/20-3/23': [spdur['Cumulative Return During Crash'].iloc[-1],MOdur['Cumulative Return During Crash'].iloc[-1],ADMdur['Cumulative Return During Crash'].iloc[-1],BFBdur['Cumulative Return During Crash'].iloc[-1],CPBdur['Cumulative Return During Crash'].iloc[-1],CHDdur['Cumulative Return During Crash'].iloc[-1],CLXdur['Cumulative Return During Crash'].iloc[-1],KOdur['Cumulative Return During Crash'].iloc[-1],CLdur['Cumulative Return During Crash'].iloc[-1],CAGdur['Cumulative Return During Crash'].iloc[-1],STZdur['Cumulative Return During Crash'].iloc[-1],COSTdur['Cumulative Return During Crash'].iloc[-1],COTYdur['Cumulative Return During Crash'].iloc[-1],ELdur['Cumulative Return During Crash'].iloc[-1],GISdur['Cumulative Return During Crash'].iloc[-1],HSYdur['Cumulative Return During Crash'].iloc[-1],HRLdur['Cumulative Return During Crash'].iloc[-1],SJMdur['Cumulative Return During Crash'].iloc[-1],Kdur['Cumulative Return During Crash'].iloc[-1],KMBdur['Cumulative Return During Crash'].iloc[-1],KHCdur['Cumulative Return During Crash'].iloc[-1],KRdur['Cumulative Return During Crash'].iloc[-1],LWdur['Cumulative Return During Crash'].iloc[-1],MKCdur['Cumulative Return During Crash'].iloc[-1],TAPdur['Cumulative Return During Crash'].iloc[-1],MDLZdur['Cumulative Return During Crash'].iloc[-1],MNSTdur['Cumulative Return During Crash'].iloc[-1],PEPdur['Cumulative Return During Crash'].iloc[-1],PMdur['Cumulative Return During Crash'].iloc[-1],PGdur['Cumulative Return During Crash'].iloc[-1],SYYdur['Cumulative Return During Crash'].iloc[-1],TSNdur['Cumulative Return During Crash'].iloc[-1],WMTdur['Cumulative Return During Crash'].iloc[-1],WBAdur['Cumulative Return During Crash'].iloc[-1]],
'Cumulative Returns 3/23-6/5': [spaft['Cumulative Return After Crash'].iloc[-1],MOaft['Cumulative Return After Crash'].iloc[-1],ADMaft['Cumulative Return After Crash'].iloc[-1],BFBaft['Cumulative Return After Crash'].iloc[-1],CPBaft['Cumulative Return After Crash'].iloc[-1],CHDaft['Cumulative Return After Crash'].iloc[-1],CLXaft['Cumulative Return After Crash'].iloc[-1],KOaft['Cumulative Return After Crash'].iloc[-1],CLaft['Cumulative Return After Crash'].iloc[-1],CAGaft['Cumulative Return After Crash'].iloc[-1],STZaft['Cumulative Return After Crash'].iloc[-1],COSTaft['Cumulative Return After Crash'].iloc[-1],COTYaft['Cumulative Return After Crash'].iloc[-1],ELaft['Cumulative Return After Crash'].iloc[-1],GISaft['Cumulative Return After Crash'].iloc[-1],HSYaft['Cumulative Return After Crash'].iloc[-1],HRLaft['Cumulative Return After Crash'].iloc[-1],SJMaft['Cumulative Return After Crash'].iloc[-1],Kaft['Cumulative Return After Crash'].iloc[-1],KMBaft['Cumulative Return After Crash'].iloc[-1],KHCaft['Cumulative Return After Crash'].iloc[-1],KRaft['Cumulative Return After Crash'].iloc[-1],LWaft['Cumulative Return After Crash'].iloc[-1],MKCaft['Cumulative Return After Crash'].iloc[-1],TAPaft['Cumulative Return After Crash'].iloc[-1],MDLZaft['Cumulative Return After Crash'].iloc[-1],MNSTaft['Cumulative Return After Crash'].iloc[-1],PEPaft['Cumulative Return After Crash'].iloc[-1],PMaft['Cumulative Return After Crash'].iloc[-1],PGaft['Cumulative Return After Crash'].iloc[-1],SYYaft['Cumulative Return After Crash'].iloc[-1],TSNaft['Cumulative Return After Crash'].iloc[-1],WMTaft['Cumulative Return After Crash'].iloc[-1],WBAaft['Cumulative Return After Crash'].iloc[-1]]}
cosdf2 = pd.DataFrame(cumret, columns = ['Cumulative Returns 12/4-6/5', 'Cumulative Returns 12/4-2/20', 'Cumulative Returns 2/20-3/23', 'Cumulative Returns 3/23-6/5'], index= ['S&P 500','MO','ADM','BF.B','CPB','CHD','CLX','KO','CL','CAG','STZ','COST','COTY','EL','GIS','HSY','HRL','SJM','K','KMB','KHC','KR','LW','MKC','TAP','MDLZ','MNST','PEP','PM','PG','SYY','TSN','WMT','WBA'])
pd.DataFrame(cosdf2)
cosdf2.sort_values('Cumulative Returns 3/23-6/5', ascending=False)
#Table of Key Statistics of Consumer Staples Stocks
import pandas as pd
import statistics as stats
cosmeans = [MOmean,ADMmean,BFBmean,CPBmean,CHDmean,CLXmean,KOmean,CLmean,CAGmean,STZmean,COSTmean,COTYmean,ELmean,GISmean,HSYmean,HRLmean,SJMmean,Kmean,KMBmean,KHCmean,KRmean,LWmean,MKCmean,TAPmean,MDLZmean,MNSTmean,PEPmean,PMmean,PGmean,SYYmean,TSNmean,WMTmean,WBAmean]
cosaveragemean = stats.mean(cosmeans)
cosvariances = [MOvar,ADMvar,BFBvar,CPBvar,CHDvar,CLXvar,KOvar,CLvar,CAGvar,STZvar,COSTvar,COTYvar,ELvar,GISvar,HSYvar,HRLvar,SJMvar,Kvar,KMBvar,KHCvar,KRvar,LWvar,MKCvar,TAPvar,MDLZvar,MNSTvar,PEPvar,PMvar,PGvar,SYYvar,TSNvar,WMTvar,WBAvar]
cosaveragevar = stats.mean(cosvariances)
coskurtoses = [MOkurt,ADMkurt,BFBkurt,CPBkurt,CHDkurt,CLXkurt,KOkurt,CLkurt,CAGkurt,STZkurt,COSTkurt,COTYkurt,ELkurt,GISkurt,HSYkurt,HRLkurt,SJMkurt,Kkurt,KMBkurt,KHCkurt,KRkurt,LWkurt,MKCkurt,TAPkurt,MDLZkurt,MNSTkurt,PEPkurt,PMkurt,PGkurt,SYYkurt,TSNkurt,WMTkurt,WBAkurt]
cosaveragekurt = stats.mean(coskurtoses)
cosskews = [MOskew,ADMskew,BFBskew,CPBskew,CHDskew,CLXskew,KOskew,CLskew,CAGskew,STZskew,COSTskew,COTYskew,ELskew,GISskew,HSYskew,HRLskew,SJMskew,Kskew,KMBskew,KHCskew,KRskew,LWskew,MKCskew,TAPskew,MDLZskew,MNSTskew,PEPskew,PMskew,PGskew,SYYskew,TSNskew,WMTskew,WBAskew]
cosaverageskew = stats.mean(cosskews)
Consumer_Staples = {'Mean': [[spmean],[cosaveragemean],[MOmean], [ADMmean],[BFBmean],[CPBmean],[CHDmean],[CLXmean],[KOmean],[CLmean],[CAGmean],[STZmean],[COSTmean],[COTYmean],[ELmean],[GISmean],[HSYmean],[HRLmean],[SJMmean],[Kmean],[KMBmean],[KHCmean],[KRmean],[LWmean],[MKCmean],[TAPmean],[MDLZmean],[MNSTmean],[PEPmean],[PMmean],[PGmean],[SYYmean],[TSNmean],[WMTmean],[WBAmean]],
'Variance': [[spvar],[cosaveragevar],[MOvar],[ADMvar],[BFBvar],[CPBvar],[CHDvar],[CLXvar],[KOvar],[CLvar],[CAGvar],[STZvar],[COSTvar],[COTYvar],[ELvar],[GISvar],[HSYvar],[HRLvar],[SJMvar],[Kvar],[KMBvar],[KHCvar],[KRvar],[LWvar],[MKCvar],[TAPvar],[MDLZvar],[MNSTvar],[PEPvar],[PMvar],[PGvar],[SYYvar],[TSNvar],[WMTvar],[WBAvar]],
'Kurtosis': [[spkurt],[cosaveragekurt],[MOkurt],[ADMkurt],[BFBkurt],[CPBkurt],[CHDkurt],[CLXkurt],[KOkurt],[CLkurt],[CAGkurt],[STZkurt],[COSTkurt],[COTYkurt],[ELkurt],[GISkurt],[HSYkurt],[HRLkurt],[SJMkurt],[Kkurt],[KMBkurt],[KHCkurt],[KRkurt],[LWkurt],[MKCkurt],[TAPkurt],[MDLZkurt],[MNSTkurt],[PEPkurt],[PMkurt],[PGkurt],[SYYkurt],[TSNkurt],[WMTkurt],[WBAkurt]],
'Skew': [[spskew],[cosaverageskew],[MOskew],[ADMskew],[BFBskew],[CPBskew],[CHDskew],[CLXskew],[KOskew],[CLskew],[CAGskew],[STZskew],[COSTskew],[COTYskew],[ELskew],[GISskew],[HSYskew],[HRLskew],[SJMskew],[Kskew],[KMBskew],[KHCskew],[KRskew],[LWskew],[MKCskew],[TAPskew],[MDLZskew],[MNSTskew],[PEPskew],[PMskew],[PGskew],[SYYskew],[TSNskew],[WMTskew],[WBAskew]],
}
cosdf = pd.DataFrame(Consumer_Staples, columns = ['Mean', 'Variance', 'Kurtosis', 'Skew'], index= ['S&P 500','Average','MO','ADM','BF.B','CPB','CHD','CLX','KO','CL','CAG','STZ','COST','COTY','EL','GIS','HSY','HRL','SJM','K','KMB','KHC','KR','LW','MKC','TAP','MDLZ','MNST','PEP','PM','PG','SYY','TSN','WMT','WBA']
)
pd.DataFrame(cosdf)
cosdf.sort_values("Mean", ascending=False)
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ABT = web.DataReader('ABT', 'yahoo', start, end)
ABT['returns'] = ABT['Close'].pct_change(1)
ABT['Cumulative Return'] = (1 + ABT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ABTmean = ABT['returns'].mean()
ABTvar = ABT['returns'].var()
ABTkurt = ABT['returns'].kurt()
ABTskew = ABT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ABTbef = web.DataReader('ABT', 'yahoo', start, crashstart)
ABTbef['avgreturnbefore'] = ABTbef['Close'].pct_change(1)
ABTbef['Cumulative Return Before Crash'] = (1 + ABTbef['avgreturnbefore']).cumprod()
#period of crash
ABTdur = web.DataReader('ABT', 'yahoo', crashstart, crashend)
ABTdur['avgreturnduring'] = ABTdur['Close'].pct_change(1)
ABTdur['Cumulative Return During Crash'] = (1 + ABTdur['avgreturnduring']).cumprod()
#period after crash
ABTaft = web.DataReader('ABT', 'yahoo', crashend, end)
ABTaft['avgreturnafter'] = ABTaft['Close'].pct_change(1)
ABTaft['Cumulative Return After Crash'] = (1 + ABTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ABBV = web.DataReader('ABBV', 'yahoo', start, end)
ABBV['returns'] = ABBV['Close'].pct_change(1)
ABBV['Cumulative Return'] = (1 + ABBV['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ABBVmean = ABBV['returns'].mean()
ABBVvar = ABBV['returns'].var()
ABBVkurt = ABBV['returns'].kurt()
ABBVskew = ABBV['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ABBVbef = web.DataReader('ABBV', 'yahoo', start, crashstart)
ABBVbef['avgreturnbefore'] = ABBVbef['Close'].pct_change(1)
ABBVbef['Cumulative Return Before Crash'] = (1 + ABBVbef['avgreturnbefore']).cumprod()
#period of crash
ABBVdur = web.DataReader('ABBV', 'yahoo', crashstart, crashend)
ABBVdur['avgreturnduring'] = ABBVdur['Close'].pct_change(1)
ABBVdur['Cumulative Return During Crash'] = (1 + ABBVdur['avgreturnduring']).cumprod()
#period after crash
ABBVaft = web.DataReader('ABBV', 'yahoo', crashend, end)
ABBVaft['avgreturnafter'] = ABBVaft['Close'].pct_change(1)
ABBVaft['Cumulative Return After Crash'] = (1 + ABBVaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ABMD = web.DataReader('ABMD', 'yahoo', start, end)
ABMD['returns'] = ABMD['Close'].pct_change(1)
ABMD['Cumulative Return'] = (1 + ABMD['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ABMDmean = ABMD['returns'].mean()
ABMDvar = ABMD['returns'].var()
ABMDkurt = ABMD['returns'].kurt()
ABMDskew = ABMD['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ABMDbef = web.DataReader('ABMD', 'yahoo', start, crashstart)
ABMDbef['avgreturnbefore'] = ABMDbef['Close'].pct_change(1)
ABMDbef['Cumulative Return Before Crash'] = (1 + ABMDbef['avgreturnbefore']).cumprod()
#period of crash
ABMDdur = web.DataReader('ABMD', 'yahoo', crashstart, crashend)
ABMDdur['avgreturnduring'] = ABMDdur['Close'].pct_change(1)
ABMDdur['Cumulative Return During Crash'] = (1 + ABMDdur['avgreturnduring']).cumprod()
#period after crash
ABMDaft = web.DataReader('ABMD', 'yahoo', crashend, end)
ABMDaft['avgreturnafter'] = ABMDaft['Close'].pct_change(1)
ABMDaft['Cumulative Return After Crash'] = (1 + ABMDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
A = web.DataReader('A', 'yahoo', start, end)
A['returns'] = A['Close'].pct_change(1)
A['Cumulative Return'] = (1 + A['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
Amean = A['returns'].mean()
Avar = A['returns'].var()
Akurt = A['returns'].kurt()
Askew = A['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
Abef = web.DataReader('A', 'yahoo', start, crashstart)
Abef['avgreturnbefore'] = Abef['Close'].pct_change(1)
Abef['Cumulative Return Before Crash'] = (1 + Abef['avgreturnbefore']).cumprod()
#period of crash
Adur = web.DataReader('A', 'yahoo', crashstart, crashend)
Adur['avgreturnduring'] = Adur['Close'].pct_change(1)
Adur['Cumulative Return During Crash'] = (1 + Adur['avgreturnduring']).cumprod()
#period after crash
Aaft = web.DataReader('A', 'yahoo', crashend, end)
Aaft['avgreturnafter'] = Aaft['Close'].pct_change(1)
Aaft['Cumulative Return After Crash'] = (1 + Aaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ALXN = web.DataReader('ALXN', 'yahoo', start, end)
ALXN['returns'] = ALXN['Close'].pct_change(1)
ALXN['Cumulative Return'] = (1 + ALXN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ALXNmean = ALXN['returns'].mean()
ALXNvar = ALXN['returns'].var()
ALXNkurt = ALXN['returns'].kurt()
ALXNskew = ALXN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ALXNbef = web.DataReader('ALXN', 'yahoo', start, crashstart)
ALXNbef['avgreturnbefore'] = ALXNbef['Close'].pct_change(1)
ALXNbef['Cumulative Return Before Crash'] = (1 + ALXNbef['avgreturnbefore']).cumprod()
#period of crash
ALXNdur = web.DataReader('ALXN', 'yahoo', crashstart, crashend)
ALXNdur['avgreturnduring'] = ALXNdur['Close'].pct_change(1)
ALXNdur['Cumulative Return During Crash'] = (1 + ALXNdur['avgreturnduring']).cumprod()
#period after crash
ALXNaft = web.DataReader('ALXN', 'yahoo', crashend, end)
ALXNaft['avgreturnafter'] = ALXNaft['Close'].pct_change(1)
ALXNaft['Cumulative Return After Crash'] = (1 + ALXNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ALGN = web.DataReader('ALGN', 'yahoo', start, end)
ALGN['returns'] = ALGN['Close'].pct_change(1)
ALGN['Cumulative Return'] = (1 + ALGN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ALGNmean = ALGN['returns'].mean()
ALGNvar = ALGN['returns'].var()
ALGNkurt = ALGN['returns'].kurt()
ALGNskew = ALGN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ALGNbef = web.DataReader('ALGN', 'yahoo', start, crashstart)
ALGNbef['avgreturnbefore'] = ALGNbef['Close'].pct_change(1)
ALGNbef['Cumulative Return Before Crash'] = (1 + ALGNbef['avgreturnbefore']).cumprod()
#period of crash
ALGNdur = web.DataReader('ALGN', 'yahoo', crashstart, crashend)
ALGNdur['avgreturnduring'] = ALGNdur['Close'].pct_change(1)
ALGNdur['Cumulative Return During Crash'] = (1 + ALGNdur['avgreturnduring']).cumprod()
#period after crash
ALGNaft = web.DataReader('ALGN', 'yahoo', crashend, end)
ALGNaft['avgreturnafter'] = ALGNaft['Close'].pct_change(1)
ALGNaft['Cumulative Return After Crash'] = (1 + ALGNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ABC = web.DataReader('ABC', 'yahoo', start, end)
ABC['returns'] = ABC['Close'].pct_change(1)
ABC['Cumulative Return'] = (1 + ABC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ABCmean = ABC['returns'].mean()
ABCvar = ABC['returns'].var()
ABCkurt = ABC['returns'].kurt()
ABCskew = ABC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ABCbef = web.DataReader('ABC', 'yahoo', start, crashstart)
ABCbef['avgreturnbefore'] = ABCbef['Close'].pct_change(1)
ABCbef['Cumulative Return Before Crash'] = (1 + ABCbef['avgreturnbefore']).cumprod()
#period of crash
ABCdur = web.DataReader('ABC', 'yahoo', crashstart, crashend)
ABCdur['avgreturnduring'] = ABCdur['Close'].pct_change(1)
ABCdur['Cumulative Return During Crash'] = (1 + ABCdur['avgreturnduring']).cumprod()
#period after crash
ABCaft = web.DataReader('ABC', 'yahoo', crashend, end)
ABCaft['avgreturnafter'] = ABCaft['Close'].pct_change(1)
ABCaft['Cumulative Return After Crash'] = (1 + ABCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AMGN = web.DataReader('AMGN', 'yahoo', start, end)
AMGN['returns'] = AMGN['Close'].pct_change(1)
AMGN['Cumulative Return'] = (1 + AMGN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AMGNmean = AMGN['returns'].mean()
AMGNvar = AMGN['returns'].var()
AMGNkurt = AMGN['returns'].kurt()
AMGNskew = AMGN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AMGNbef = web.DataReader('AMGN', 'yahoo', start, crashstart)
AMGNbef['avgreturnbefore'] = AMGNbef['Close'].pct_change(1)
AMGNbef['Cumulative Return Before Crash'] = (1 + AMGNbef['avgreturnbefore']).cumprod()
#period of crash
AMGNdur = web.DataReader('AMGN', 'yahoo', crashstart, crashend)
AMGNdur['avgreturnduring'] = AMGNdur['Close'].pct_change(1)
AMGNdur['Cumulative Return During Crash'] = (1 + AMGNdur['avgreturnduring']).cumprod()
#period after crash
AMGNaft = web.DataReader('AMGN', 'yahoo', crashend, end)
AMGNaft['avgreturnafter'] = AMGNaft['Close'].pct_change(1)
AMGNaft['Cumulative Return After Crash'] = (1 + AMGNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ANTM = web.DataReader('ANTM', 'yahoo', start, end)
ANTM['returns'] = ANTM['Close'].pct_change(1)
ANTM['Cumulative Return'] = (1 + ANTM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ANTMmean = ANTM['returns'].mean()
ANTMvar = ANTM['returns'].var()
ANTMkurt = ANTM['returns'].kurt()
ANTMskew = ANTM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ANTMbef = web.DataReader('ANTM', 'yahoo', start, crashstart)
ANTMbef['avgreturnbefore'] = ANTMbef['Close'].pct_change(1)
ANTMbef['Cumulative Return Before Crash'] = (1 + ANTMbef['avgreturnbefore']).cumprod()
#period of crash
ANTMdur = web.DataReader('ANTM', 'yahoo', crashstart, crashend)
ANTMdur['avgreturnduring'] = ANTMdur['Close'].pct_change(1)
ANTMdur['Cumulative Return During Crash'] = (1 + ANTMdur['avgreturnduring']).cumprod()
#period after crash
ANTMaft = web.DataReader('ANTM', 'yahoo', crashend, end)
ANTMaft['avgreturnafter'] = ANTMaft['Close'].pct_change(1)
ANTMaft['Cumulative Return After Crash'] = (1 + ANTMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BAX = web.DataReader('BAX', 'yahoo', start, end)
BAX['returns'] = BAX['Close'].pct_change(1)
BAX['Cumulative Return'] = (1 + BAX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BAXmean = BAX['returns'].mean()
BAXvar = BAX['returns'].var()
BAXkurt = BAX['returns'].kurt()
BAXskew = BAX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BAXbef = web.DataReader('BAX', 'yahoo', start, crashstart)
BAXbef['avgreturnbefore'] = BAXbef['Close'].pct_change(1)
BAXbef['Cumulative Return Before Crash'] = (1 + BAXbef['avgreturnbefore']).cumprod()
#period of crash
BAXdur = web.DataReader('BAX', 'yahoo', crashstart, crashend)
BAXdur['avgreturnduring'] = BAXdur['Close'].pct_change(1)
BAXdur['Cumulative Return During Crash'] = (1 + BAXdur['avgreturnduring']).cumprod()
#period after crash
BAXaft = web.DataReader('BAX', 'yahoo', crashend, end)
BAXaft['avgreturnafter'] = BAXaft['Close'].pct_change(1)
BAXaft['Cumulative Return After Crash'] = (1 + BAXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BDX = web.DataReader('BDX', 'yahoo', start, end)
BDX['returns'] = BDX['Close'].pct_change(1)
BDX['Cumulative Return'] = (1 + BDX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BDXmean = BDX['returns'].mean()
BDXvar = BDX['returns'].var()
BDXkurt = BDX['returns'].kurt()
BDXskew = BDX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BDXbef = web.DataReader('BDX', 'yahoo', start, crashstart)
BDXbef['avgreturnbefore'] = BDXbef['Close'].pct_change(1)
BDXbef['Cumulative Return Before Crash'] = (1 + BDXbef['avgreturnbefore']).cumprod()
#period of crash
BDXdur = web.DataReader('BDX', 'yahoo', crashstart, crashend)
BDXdur['avgreturnduring'] = BDXdur['Close'].pct_change(1)
BDXdur['Cumulative Return During Crash'] = (1 + BDXdur['avgreturnduring']).cumprod()
#period after crash
BDXaft = web.DataReader('BDX', 'yahoo', crashend, end)
BDXaft['avgreturnafter'] = BDXaft['Close'].pct_change(1)
BDXaft['Cumulative Return After Crash'] = (1 + BDXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BIIB = web.DataReader('BIIB', 'yahoo', start, end)
BIIB['returns'] = BIIB['Close'].pct_change(1)
BIIB['Cumulative Return'] = (1 + BIIB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BIIBmean = BIIB['returns'].mean()
BIIBvar = BIIB['returns'].var()
BIIBkurt = BIIB['returns'].kurt()
BIIBskew = BIIB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BIIBbef = web.DataReader('BIIB', 'yahoo', start, crashstart)
BIIBbef['avgreturnbefore'] = BIIBbef['Close'].pct_change(1)
BIIBbef['Cumulative Return Before Crash'] = (1 + BIIBbef['avgreturnbefore']).cumprod()
#period of crash
BIIBdur = web.DataReader('BIIB', 'yahoo', crashstart, crashend)
BIIBdur['avgreturnduring'] = BIIBdur['Close'].pct_change(1)
BIIBdur['Cumulative Return During Crash'] = (1 + BIIBdur['avgreturnduring']).cumprod()
#period after crash
BIIBaft = web.DataReader('BIIB', 'yahoo', crashend, end)
BIIBaft['avgreturnafter'] = BIIBaft['Close'].pct_change(1)
BIIBaft['Cumulative Return After Crash'] = (1 + BIIBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BSX = web.DataReader('BSX', 'yahoo', start, end)
BSX['returns'] = BSX['Close'].pct_change(1)
BSX['Cumulative Return'] = (1 + BSX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BSXmean = BSX['returns'].mean()
BSXvar = BSX['returns'].var()
BSXkurt = BSX['returns'].kurt()
BSXskew = BSX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BSXbef = web.DataReader('BSX', 'yahoo', start, crashstart)
BSXbef['avgreturnbefore'] = BSXbef['Close'].pct_change(1)
BSXbef['Cumulative Return Before Crash'] = (1 + BSXbef['avgreturnbefore']).cumprod()
#period of crash
BSXdur = web.DataReader('BSX', 'yahoo', crashstart, crashend)
BSXdur['avgreturnduring'] = BSXdur['Close'].pct_change(1)
BSXdur['Cumulative Return During Crash'] = (1 + BSXdur['avgreturnduring']).cumprod()
#period after crash
BSXaft = web.DataReader('BSX', 'yahoo', crashend, end)
BSXaft['avgreturnafter'] = BSXaft['Close'].pct_change(1)
BSXaft['Cumulative Return After Crash'] = (1 + BSXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BMY = web.DataReader('BMY', 'yahoo', start, end)
BMY['returns'] = BMY['Close'].pct_change(1)
BMY['Cumulative Return'] = (1 + BMY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BMYmean = BMY['returns'].mean()
BMYvar = BMY['returns'].var()
BMYkurt = BMY['returns'].kurt()
BMYskew = BMY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BMYbef = web.DataReader('BMY', 'yahoo', start, crashstart)
BMYbef['avgreturnbefore'] = BMYbef['Close'].pct_change(1)
BMYbef['Cumulative Return Before Crash'] = (1 + BMYbef['avgreturnbefore']).cumprod()
#period of crash
BMYdur = web.DataReader('BMY', 'yahoo', crashstart, crashend)
BMYdur['avgreturnduring'] = BMYdur['Close'].pct_change(1)
BMYdur['Cumulative Return During Crash'] = (1 + BMYdur['avgreturnduring']).cumprod()
#period after crash
BMYaft = web.DataReader('BMY', 'yahoo', crashend, end)
BMYaft['avgreturnafter'] = BMYaft['Close'].pct_change(1)
BMYaft['Cumulative Return After Crash'] = (1 + BMYaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CAH = web.DataReader('CAH', 'yahoo', start, end)
CAH['returns'] = CAH['Close'].pct_change(1)
CAH['Cumulative Return'] = (1 + CAH['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CAHmean = CAH['returns'].mean()
CAHvar = CAH['returns'].var()
CAHkurt = CAH['returns'].kurt()
CAHskew = CAH['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CAHbef = web.DataReader('CAH', 'yahoo', start, crashstart)
CAHbef['avgreturnbefore'] = CAHbef['Close'].pct_change(1)
CAHbef['Cumulative Return Before Crash'] = (1 + CAHbef['avgreturnbefore']).cumprod()
#period of crash
CAHdur = web.DataReader('CAH', 'yahoo', crashstart, crashend)
CAHdur['avgreturnduring'] = CAHdur['Close'].pct_change(1)
CAHdur['Cumulative Return During Crash'] = (1 + CAHdur['avgreturnduring']).cumprod()
#period after crash
CAHaft = web.DataReader('CAH', 'yahoo', crashend, end)
CAHaft['avgreturnafter'] = CAHaft['Close'].pct_change(1)
CAHaft['Cumulative Return After Crash'] = (1 + CAHaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CNC = web.DataReader('CNC', 'yahoo', start, end)
CNC['returns'] = CNC['Close'].pct_change(1)
CNC['Cumulative Return'] = (1 + CNC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CNCmean = CNC['returns'].mean()
CNCvar = CNC['returns'].var()
CNCkurt = CNC['returns'].kurt()
CNCskew = CNC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CNCbef = web.DataReader('CNC', 'yahoo', start, crashstart)
CNCbef['avgreturnbefore'] = CNCbef['Close'].pct_change(1)
CNCbef['Cumulative Return Before Crash'] = (1 + CNCbef['avgreturnbefore']).cumprod()
#period of crash
CNCdur = web.DataReader('CNC', 'yahoo', crashstart, crashend)
CNCdur['avgreturnduring'] = CNCdur['Close'].pct_change(1)
CNCdur['Cumulative Return During Crash'] = (1 + CNCdur['avgreturnduring']).cumprod()
#period after crash
CNCaft = web.DataReader('CNC', 'yahoo', crashend, end)
CNCaft['avgreturnafter'] = CNCaft['Close'].pct_change(1)
CNCaft['Cumulative Return After Crash'] = (1 + CNCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CERN = web.DataReader('CERN', 'yahoo', start, end)
CERN['returns'] = CERN['Close'].pct_change(1)
CERN['Cumulative Return'] = (1 + CERN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CERNmean = CERN['returns'].mean()
CERNvar = CERN['returns'].var()
CERNkurt = CERN['returns'].kurt()
CERNskew = CERN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CERNbef = web.DataReader('CERN', 'yahoo', start, crashstart)
CERNbef['avgreturnbefore'] = CERNbef['Close'].pct_change(1)
CERNbef['Cumulative Return Before Crash'] = (1 + CERNbef['avgreturnbefore']).cumprod()
#period of crash
CERNdur = web.DataReader('CERN', 'yahoo', crashstart, crashend)
CERNdur['avgreturnduring'] = CERNdur['Close'].pct_change(1)
CERNdur['Cumulative Return During Crash'] = (1 + CERNdur['avgreturnduring']).cumprod()
#period after crash
CERNaft = web.DataReader('CERN', 'yahoo', crashend, end)
CERNaft['avgreturnafter'] = CERNaft['Close'].pct_change(1)
CERNaft['Cumulative Return After Crash'] = (1 + CERNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CI = web.DataReader('CI', 'yahoo', start, end)
CI['returns'] = CI['Close'].pct_change(1)
CI['Cumulative Return'] = (1 + CI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CImean = CI['returns'].mean()
CIvar = CI['returns'].var()
CIkurt = CI['returns'].kurt()
CIskew = CI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CIbef = web.DataReader('CI', 'yahoo', start, crashstart)
CIbef['avgreturnbefore'] = CIbef['Close'].pct_change(1)
CIbef['Cumulative Return Before Crash'] = (1 + CIbef['avgreturnbefore']).cumprod()
#period of crash
CIdur = web.DataReader('CI', 'yahoo', crashstart, crashend)
CIdur['avgreturnduring'] = CIdur['Close'].pct_change(1)
CIdur['Cumulative Return During Crash'] = (1 + CIdur['avgreturnduring']).cumprod()
#period after crash
CIaft = web.DataReader('CI', 'yahoo', crashend, end)
CIaft['avgreturnafter'] = CIaft['Close'].pct_change(1)
CIaft['Cumulative Return After Crash'] = (1 + CIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
COO = web.DataReader('COO', 'yahoo', start, end)
COO['returns'] = COO['Close'].pct_change(1)
COO['Cumulative Return'] = (1 + COO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
COOmean = COO['returns'].mean()
COOvar = COO['returns'].var()
COOkurt = COO['returns'].kurt()
COOskew = COO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
COObef = web.DataReader('COO', 'yahoo', start, crashstart)
COObef['avgreturnbefore'] = COObef['Close'].pct_change(1)
COObef['Cumulative Return Before Crash'] = (1 + COObef['avgreturnbefore']).cumprod()
#period of crash
COOdur = web.DataReader('COO', 'yahoo', crashstart, crashend)
COOdur['avgreturnduring'] = COOdur['Close'].pct_change(1)
COOdur['Cumulative Return During Crash'] = (1 + COOdur['avgreturnduring']).cumprod()
#period after crash
COOaft = web.DataReader('COO', 'yahoo', crashend, end)
COOaft['avgreturnafter'] = COOaft['Close'].pct_change(1)
COOaft['Cumulative Return After Crash'] = (1 + COOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CVS = web.DataReader('CVS', 'yahoo', start, end)
CVS['returns'] = CVS['Close'].pct_change(1)
CVS['Cumulative Return'] = (1 + CVS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CVSmean = CVS['returns'].mean()
CVSvar = CVS['returns'].var()
CVSkurt = CVS['returns'].kurt()
CVSskew = CVS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CVSbef = web.DataReader('CVS', 'yahoo', start, crashstart)
CVSbef['avgreturnbefore'] = CVSbef['Close'].pct_change(1)
CVSbef['Cumulative Return Before Crash'] = (1 + CVSbef['avgreturnbefore']).cumprod()
#period of crash
CVSdur = web.DataReader('CVS', 'yahoo', crashstart, crashend)
CVSdur['avgreturnduring'] = CVSdur['Close'].pct_change(1)
CVSdur['Cumulative Return During Crash'] = (1 + CVSdur['avgreturnduring']).cumprod()
#period after crash
CVSaft = web.DataReader('CVS', 'yahoo', crashend, end)
CVSaft['avgreturnafter'] = CVSaft['Close'].pct_change(1)
CVSaft['Cumulative Return After Crash'] = (1 + CVSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DHR = web.DataReader('DHR', 'yahoo', start, end)
DHR['returns'] = DHR['Close'].pct_change(1)
DHR['Cumulative Return'] = (1 + DHR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DHRmean = DHR['returns'].mean()
DHRvar = DHR['returns'].var()
DHRkurt = DHR['returns'].kurt()
DHRskew = DHR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DHRbef = web.DataReader('DHR', 'yahoo', start, crashstart)
DHRbef['avgreturnbefore'] = DHRbef['Close'].pct_change(1)
DHRbef['Cumulative Return Before Crash'] = (1 + DHRbef['avgreturnbefore']).cumprod()
#period of crash
DHRdur = web.DataReader('DHR', 'yahoo', crashstart, crashend)
DHRdur['avgreturnduring'] = DHRdur['Close'].pct_change(1)
DHRdur['Cumulative Return During Crash'] = (1 + DHRdur['avgreturnduring']).cumprod()
#period after crash
DHRaft = web.DataReader('DHR', 'yahoo', crashend, end)
DHRaft['avgreturnafter'] = DHRaft['Close'].pct_change(1)
DHRaft['Cumulative Return After Crash'] = (1 + DHRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DVA = web.DataReader('DVA', 'yahoo', start, end)
DVA['returns'] = DVA['Close'].pct_change(1)
DVA['Cumulative Return'] = (1 + DVA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DVAmean = DVA['returns'].mean()
DVAvar = DVA['returns'].var()
DVAkurt = DVA['returns'].kurt()
DVAskew = DVA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DVAbef = web.DataReader('DVA', 'yahoo', start, crashstart)
DVAbef['avgreturnbefore'] = DVAbef['Close'].pct_change(1)
DVAbef['Cumulative Return Before Crash'] = (1 + DVAbef['avgreturnbefore']).cumprod()
#period of crash
DVAdur = web.DataReader('DVA', 'yahoo', crashstart, crashend)
DVAdur['avgreturnduring'] = DVAdur['Close'].pct_change(1)
DVAdur['Cumulative Return During Crash'] = (1 + DVAdur['avgreturnduring']).cumprod()
#period after crash
DVAaft = web.DataReader('DVA', 'yahoo', crashend, end)
DVAaft['avgreturnafter'] = DVAaft['Close'].pct_change(1)
DVAaft['Cumulative Return After Crash'] = (1 + DVAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
XRAY = web.DataReader('XRAY', 'yahoo', start, end)
XRAY['returns'] = XRAY['Close'].pct_change(1)
XRAY['Cumulative Return'] = (1 + XRAY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
XRAYmean = XRAY['returns'].mean()
XRAYvar = XRAY['returns'].var()
XRAYkurt = XRAY['returns'].kurt()
XRAYskew = XRAY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
XRAYbef = web.DataReader('XRAY', 'yahoo', start, crashstart)
XRAYbef['avgreturnbefore'] = XRAYbef['Close'].pct_change(1)
XRAYbef['Cumulative Return Before Crash'] = (1 + XRAYbef['avgreturnbefore']).cumprod()
#period of crash
XRAYdur = web.DataReader('XRAY', 'yahoo', crashstart, crashend)
XRAYdur['avgreturnduring'] = XRAYdur['Close'].pct_change(1)
XRAYdur['Cumulative Return During Crash'] = (1 + XRAYdur['avgreturnduring']).cumprod()
#period after crash
XRAYaft = web.DataReader('XRAY', 'yahoo', crashend, end)
XRAYaft['avgreturnafter'] = XRAYaft['Close'].pct_change(1)
XRAYaft['Cumulative Return After Crash'] = (1 + XRAYaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DXCM = web.DataReader('DXCM', 'yahoo', start, end)
DXCM['returns'] = DXCM['Close'].pct_change(1)
DXCM['Cumulative Return'] = (1 + DXCM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DXCMmean = DXCM['returns'].mean()
DXCMvar = DXCM['returns'].var()
DXCMkurt = DXCM['returns'].kurt()
DXCMskew = DXCM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DXCMbef = web.DataReader('DXCM', 'yahoo', start, crashstart)
DXCMbef['avgreturnbefore'] = DXCMbef['Close'].pct_change(1)
DXCMbef['Cumulative Return Before Crash'] = (1 + DXCMbef['avgreturnbefore']).cumprod()
#period of crash
DXCMdur = web.DataReader('DXCM', 'yahoo', crashstart, crashend)
DXCMdur['avgreturnduring'] = DXCMdur['Close'].pct_change(1)
DXCMdur['Cumulative Return During Crash'] = (1 + DXCMdur['avgreturnduring']).cumprod()
#period after crash
DXCMaft = web.DataReader('DXCM', 'yahoo', crashend, end)
DXCMaft['avgreturnafter'] = DXCMaft['Close'].pct_change(1)
DXCMaft['Cumulative Return After Crash'] = (1 + DXCMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EW = web.DataReader('EW', 'yahoo', start, end)
EW['returns'] = EW['Close'].pct_change(1)
EW['Cumulative Return'] = (1 + EW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EWmean = EW['returns'].mean()
EWvar = EW['returns'].var()
EWkurt = EW['returns'].kurt()
EWskew = EW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EWbef = web.DataReader('EW', 'yahoo', start, crashstart)
EWbef['avgreturnbefore'] = EWbef['Close'].pct_change(1)
EWbef['Cumulative Return Before Crash'] = (1 + EWbef['avgreturnbefore']).cumprod()
#period of crash
EWdur = web.DataReader('EW', 'yahoo', crashstart, crashend)
EWdur['avgreturnduring'] = EWdur['Close'].pct_change(1)
EWdur['Cumulative Return During Crash'] = (1 + EWdur['avgreturnduring']).cumprod()
#period after crash
EWaft = web.DataReader('EW', 'yahoo', crashend, end)
EWaft['avgreturnafter'] = EWaft['Close'].pct_change(1)
EWaft['Cumulative Return After Crash'] = (1 + EWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GILD = web.DataReader('GILD', 'yahoo', start, end)
GILD['returns'] = GILD['Close'].pct_change(1)
GILD['Cumulative Return'] = (1 + GILD['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GILDmean = GILD['returns'].mean()
GILDvar = GILD['returns'].var()
GILDkurt = GILD['returns'].kurt()
GILDskew = GILD['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GILDbef = web.DataReader('GILD', 'yahoo', start, crashstart)
GILDbef['avgreturnbefore'] = GILDbef['Close'].pct_change(1)
GILDbef['Cumulative Return Before Crash'] = (1 + GILDbef['avgreturnbefore']).cumprod()
#period of crash
GILDdur = web.DataReader('GILD', 'yahoo', crashstart, crashend)
GILDdur['avgreturnduring'] = GILDdur['Close'].pct_change(1)
GILDdur['Cumulative Return During Crash'] = (1 + GILDdur['avgreturnduring']).cumprod()
#period after crash
GILDaft = web.DataReader('GILD', 'yahoo', crashend, end)
GILDaft['avgreturnafter'] = GILDaft['Close'].pct_change(1)
GILDaft['Cumulative Return After Crash'] = (1 + GILDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HCA = web.DataReader('HCA', 'yahoo', start, end)
HCA['returns'] = HCA['Close'].pct_change(1)
HCA['Cumulative Return'] = (1 + HCA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HCAmean = HCA['returns'].mean()
HCAvar = HCA['returns'].var()
HCAkurt = HCA['returns'].kurt()
HCAskew = HCA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HCAbef = web.DataReader('HCA', 'yahoo', start, crashstart)
HCAbef['avgreturnbefore'] = HCAbef['Close'].pct_change(1)
HCAbef['Cumulative Return Before Crash'] = (1 + HCAbef['avgreturnbefore']).cumprod()
#period of crash
HCAdur = web.DataReader('HCA', 'yahoo', crashstart, crashend)
HCAdur['avgreturnduring'] = HCAdur['Close'].pct_change(1)
HCAdur['Cumulative Return During Crash'] = (1 + HCAdur['avgreturnduring']).cumprod()
#period after crash
HCAaft = web.DataReader('HCA', 'yahoo', crashend, end)
HCAaft['avgreturnafter'] = HCAaft['Close'].pct_change(1)
HCAaft['Cumulative Return After Crash'] = (1 + HCAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HSIC = web.DataReader('HSIC', 'yahoo', start, end)
HSIC['returns'] = HSIC['Close'].pct_change(1)
HSIC['Cumulative Return'] = (1 + HSIC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HSICmean = HSIC['returns'].mean()
HSICvar = HSIC['returns'].var()
HSICkurt = HSIC['returns'].kurt()
HSICskew = HSIC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HSICbef = web.DataReader('HSIC', 'yahoo', start, crashstart)
HSICbef['avgreturnbefore'] = HSICbef['Close'].pct_change(1)
HSICbef['Cumulative Return Before Crash'] = (1 + HSICbef['avgreturnbefore']).cumprod()
#period of crash
HSICdur = web.DataReader('HSIC', 'yahoo', crashstart, crashend)
HSICdur['avgreturnduring'] = HSICdur['Close'].pct_change(1)
HSICdur['Cumulative Return During Crash'] = (1 + HSICdur['avgreturnduring']).cumprod()
#period after crash
HSICaft = web.DataReader('HSIC', 'yahoo', crashend, end)
HSICaft['avgreturnafter'] = HSICaft['Close'].pct_change(1)
HSICaft['Cumulative Return After Crash'] = (1 + HSICaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HOLX = web.DataReader('HOLX', 'yahoo', start, end)
HOLX['returns'] = HOLX['Close'].pct_change(1)
HOLX['Cumulative Return'] = (1 + HOLX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HOLXmean = HOLX['returns'].mean()
HOLXvar = HOLX['returns'].var()
HOLXkurt = HOLX['returns'].kurt()
HOLXskew = HOLX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HOLXbef = web.DataReader('HOLX', 'yahoo', start, crashstart)
HOLXbef['avgreturnbefore'] = HOLXbef['Close'].pct_change(1)
HOLXbef['Cumulative Return Before Crash'] = (1 + HOLXbef['avgreturnbefore']).cumprod()
#period of crash
HOLXdur = web.DataReader('HOLX', 'yahoo', crashstart, crashend)
HOLXdur['avgreturnduring'] = HOLXdur['Close'].pct_change(1)
HOLXdur['Cumulative Return During Crash'] = (1 + HOLXdur['avgreturnduring']).cumprod()
#period after crash
HOLXaft = web.DataReader('HOLX', 'yahoo', crashend, end)
HOLXaft['avgreturnafter'] = HOLXaft['Close'].pct_change(1)
HOLXaft['Cumulative Return After Crash'] = (1 + HOLXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HUM = web.DataReader('HUM', 'yahoo', start, end)
HUM['returns'] = HUM['Close'].pct_change(1)
HUM['Cumulative Return'] = (1 + HUM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HUMmean = HUM['returns'].mean()
HUMvar = HUM['returns'].var()
HUMkurt = HUM['returns'].kurt()
HUMskew = HUM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HUMbef = web.DataReader('HUM', 'yahoo', start, crashstart)
HUMbef['avgreturnbefore'] = HUMbef['Close'].pct_change(1)
HUMbef['Cumulative Return Before Crash'] = (1 + HUMbef['avgreturnbefore']).cumprod()
#period of crash
HUMdur = web.DataReader('HUM', 'yahoo', crashstart, crashend)
HUMdur['avgreturnduring'] = HUMdur['Close'].pct_change(1)
HUMdur['Cumulative Return During Crash'] = (1 + HUMdur['avgreturnduring']).cumprod()
#period after crash
HUMaft = web.DataReader('HUM', 'yahoo', crashend, end)
HUMaft['avgreturnafter'] = HUMaft['Close'].pct_change(1)
HUMaft['Cumulative Return After Crash'] = (1 + HUMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
IDXX = web.DataReader('IDXX', 'yahoo', start, end)
IDXX['returns'] = IDXX['Close'].pct_change(1)
IDXX['Cumulative Return'] = (1 + IDXX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
IDXXmean = IDXX['returns'].mean()
IDXXvar = IDXX['returns'].var()
IDXXkurt = IDXX['returns'].kurt()
IDXXskew = IDXX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
IDXXbef = web.DataReader('IDXX', 'yahoo', start, crashstart)
IDXXbef['avgreturnbefore'] = IDXXbef['Close'].pct_change(1)
IDXXbef['Cumulative Return Before Crash'] = (1 + IDXXbef['avgreturnbefore']).cumprod()
#period of crash
IDXXdur = web.DataReader('IDXX', 'yahoo', crashstart, crashend)
IDXXdur['avgreturnduring'] = IDXXdur['Close'].pct_change(1)
IDXXdur['Cumulative Return During Crash'] = (1 + IDXXdur['avgreturnduring']).cumprod()
#period after crash
IDXXaft = web.DataReader('IDXX', 'yahoo', crashend, end)
IDXXaft['avgreturnafter'] = IDXXaft['Close'].pct_change(1)
IDXXaft['Cumulative Return After Crash'] = (1 + IDXXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ILMN = web.DataReader('ILMN', 'yahoo', start, end)
ILMN['returns'] = ILMN['Close'].pct_change(1)
ILMN['Cumulative Return'] = (1 + ILMN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ILMNmean = ILMN['returns'].mean()
ILMNvar = ILMN['returns'].var()
ILMNkurt = ILMN['returns'].kurt()
ILMNskew = ILMN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ILMNbef = web.DataReader('ILMN', 'yahoo', start, crashstart)
ILMNbef['avgreturnbefore'] = ILMNbef['Close'].pct_change(1)
ILMNbef['Cumulative Return Before Crash'] = (1 + ILMNbef['avgreturnbefore']).cumprod()
#period of crash
ILMNdur = web.DataReader('ILMN', 'yahoo', crashstart, crashend)
ILMNdur['avgreturnduring'] = ILMNdur['Close'].pct_change(1)
ILMNdur['Cumulative Return During Crash'] = (1 + ILMNdur['avgreturnduring']).cumprod()
#period after crash
ILMNaft = web.DataReader('ILMN', 'yahoo', crashend, end)
ILMNaft['avgreturnafter'] = ILMNaft['Close'].pct_change(1)
ILMNaft['Cumulative Return After Crash'] = (1 + ILMNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
INCY = web.DataReader('INCY', 'yahoo', start, end)
INCY['returns'] = INCY['Close'].pct_change(1)
INCY['Cumulative Return'] = (1 + INCY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
INCYmean = INCY['returns'].mean()
INCYvar = INCY['returns'].var()
INCYkurt = INCY['returns'].kurt()
INCYskew = INCY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
INCYbef = web.DataReader('INCY', 'yahoo', start, crashstart)
INCYbef['avgreturnbefore'] = INCYbef['Close'].pct_change(1)
INCYbef['Cumulative Return Before Crash'] = (1 + INCYbef['avgreturnbefore']).cumprod()
#period of crash
INCYdur = web.DataReader('INCY', 'yahoo', crashstart, crashend)
INCYdur['avgreturnduring'] = INCYdur['Close'].pct_change(1)
INCYdur['Cumulative Return During Crash'] = (1 + INCYdur['avgreturnduring']).cumprod()
#period after crash
INCYaft = web.DataReader('INCY', 'yahoo', crashend, end)
INCYaft['avgreturnafter'] = INCYaft['Close'].pct_change(1)
INCYaft['Cumulative Return After Crash'] = (1 + INCYaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ISRG = web.DataReader('ISRG', 'yahoo', start, end)
ISRG['returns'] = ISRG['Close'].pct_change(1)
ISRG['Cumulative Return'] = (1 + ISRG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ISRGmean = ISRG['returns'].mean()
ISRGvar = ISRG['returns'].var()
ISRGkurt = ISRG['returns'].kurt()
ISRGskew = ISRG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ISRGbef = web.DataReader('ISRG', 'yahoo', start, crashstart)
ISRGbef['avgreturnbefore'] = ISRGbef['Close'].pct_change(1)
ISRGbef['Cumulative Return Before Crash'] = (1 + ISRGbef['avgreturnbefore']).cumprod()
#period of crash
ISRGdur = web.DataReader('ISRG', 'yahoo', crashstart, crashend)
ISRGdur['avgreturnduring'] = ISRGdur['Close'].pct_change(1)
ISRGdur['Cumulative Return During Crash'] = (1 + ISRGdur['avgreturnduring']).cumprod()
#period after crash
ISRGaft = web.DataReader('ISRG', 'yahoo', crashend, end)
ISRGaft['avgreturnafter'] = ISRGaft['Close'].pct_change(1)
ISRGaft['Cumulative Return After Crash'] = (1 + ISRGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
IQV = web.DataReader('IQV', 'yahoo', start, end)
IQV['returns'] = IQV['Close'].pct_change(1)
IQV['Cumulative Return'] = (1 + IQV['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
IQVmean = IQV['returns'].mean()
IQVvar = IQV['returns'].var()
IQVkurt = IQV['returns'].kurt()
IQVskew = IQV['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
IQVbef = web.DataReader('IQV', 'yahoo', start, crashstart)
IQVbef['avgreturnbefore'] = IQVbef['Close'].pct_change(1)
IQVbef['Cumulative Return Before Crash'] = (1 + IQVbef['avgreturnbefore']).cumprod()
#period of crash
IQVdur = web.DataReader('IQV', 'yahoo', crashstart, crashend)
IQVdur['avgreturnduring'] = IQVdur['Close'].pct_change(1)
IQVdur['Cumulative Return During Crash'] = (1 + IQVdur['avgreturnduring']).cumprod()
#period after crash
IQVaft = web.DataReader('IQV', 'yahoo', crashend, end)
IQVaft['avgreturnafter'] = IQVaft['Close'].pct_change(1)
IQVaft['Cumulative Return After Crash'] = (1 + IQVaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
JNJ = web.DataReader('JNJ', 'yahoo', start, end)
JNJ['returns'] = JNJ['Close'].pct_change(1)
JNJ['Cumulative Return'] = (1 + JNJ['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
JNJmean = JNJ['returns'].mean()
JNJvar = JNJ['returns'].var()
JNJkurt = JNJ['returns'].kurt()
JNJskew = JNJ['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
JNJbef = web.DataReader('JNJ', 'yahoo', start, crashstart)
JNJbef['avgreturnbefore'] = JNJbef['Close'].pct_change(1)
JNJbef['Cumulative Return Before Crash'] = (1 + JNJbef['avgreturnbefore']).cumprod()
#period of crash
JNJdur = web.DataReader('JNJ', 'yahoo', crashstart, crashend)
JNJdur['avgreturnduring'] = JNJdur['Close'].pct_change(1)
JNJdur['Cumulative Return During Crash'] = (1 + JNJdur['avgreturnduring']).cumprod()
#period after crash
JNJaft = web.DataReader('JNJ', 'yahoo', crashend, end)
JNJaft['avgreturnafter'] = JNJaft['Close'].pct_change(1)
JNJaft['Cumulative Return After Crash'] = (1 + JNJaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LH = web.DataReader('LH', 'yahoo', start, end)
LH['returns'] = LH['Close'].pct_change(1)
LH['Cumulative Return'] = (1 + LH['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LHmean = LH['returns'].mean()
LHvar = LH['returns'].var()
LHkurt = LH['returns'].kurt()
LHskew = LH['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LHbef = web.DataReader('LH', 'yahoo', start, crashstart)
LHbef['avgreturnbefore'] = LHbef['Close'].pct_change(1)
LHbef['Cumulative Return Before Crash'] = (1 + LHbef['avgreturnbefore']).cumprod()
#period of crash
LHdur = web.DataReader('LH', 'yahoo', crashstart, crashend)
LHdur['avgreturnduring'] = LHdur['Close'].pct_change(1)
LHdur['Cumulative Return During Crash'] = (1 + LHdur['avgreturnduring']).cumprod()
#period after crash
LHaft = web.DataReader('LH', 'yahoo', crashend, end)
LHaft['avgreturnafter'] = LHaft['Close'].pct_change(1)
LHaft['Cumulative Return After Crash'] = (1 + LHaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LLY = web.DataReader('LLY', 'yahoo', start, end)
LLY['returns'] = LLY['Close'].pct_change(1)
LLY['Cumulative Return'] = (1 + LLY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LLYmean = LLY['returns'].mean()
LLYvar = LLY['returns'].var()
LLYkurt = LLY['returns'].kurt()
LLYskew = LLY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LLYbef = web.DataReader('LLY', 'yahoo', start, crashstart)
LLYbef['avgreturnbefore'] = LLYbef['Close'].pct_change(1)
LLYbef['Cumulative Return Before Crash'] = (1 + LLYbef['avgreturnbefore']).cumprod()
#period of crash
LLYdur = web.DataReader('LLY', 'yahoo', crashstart, crashend)
LLYdur['avgreturnduring'] = LLYdur['Close'].pct_change(1)
LLYdur['Cumulative Return During Crash'] = (1 + LLYdur['avgreturnduring']).cumprod()
#period after crash
LLYaft = web.DataReader('LLY', 'yahoo', crashend, end)
LLYaft['avgreturnafter'] = LLYaft['Close'].pct_change(1)
LLYaft['Cumulative Return After Crash'] = (1 + LLYaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MCK = web.DataReader('MCK', 'yahoo', start, end)
MCK['returns'] = MCK['Close'].pct_change(1)
MCK['Cumulative Return'] = (1 + MCK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MCKmean = MCK['returns'].mean()
MCKvar = MCK['returns'].var()
MCKkurt = MCK['returns'].kurt()
MCKskew = MCK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MCKbef = web.DataReader('MCK', 'yahoo', start, crashstart)
MCKbef['avgreturnbefore'] = MCKbef['Close'].pct_change(1)
MCKbef['Cumulative Return Before Crash'] = (1 + MCKbef['avgreturnbefore']).cumprod()
#period of crash
MCKdur = web.DataReader('MCK', 'yahoo', crashstart, crashend)
MCKdur['avgreturnduring'] = MCKdur['Close'].pct_change(1)
MCKdur['Cumulative Return During Crash'] = (1 + MCKdur['avgreturnduring']).cumprod()
#period after crash
MCKaft = web.DataReader('MCK', 'yahoo', crashend, end)
MCKaft['avgreturnafter'] = MCKaft['Close'].pct_change(1)
MCKaft['Cumulative Return After Crash'] = (1 + MCKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MDT = web.DataReader('MDT', 'yahoo', start, end)
MDT['returns'] = MDT['Close'].pct_change(1)
MDT['Cumulative Return'] = (1 + MDT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MDTmean = MDT['returns'].mean()
MDTvar = MDT['returns'].var()
MDTkurt = MDT['returns'].kurt()
MDTskew = MDT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MDTbef = web.DataReader('MDT', 'yahoo', start, crashstart)
MDTbef['avgreturnbefore'] = MDTbef['Close'].pct_change(1)
MDTbef['Cumulative Return Before Crash'] = (1 + MDTbef['avgreturnbefore']).cumprod()
#period of crash
MDTdur = web.DataReader('MDT', 'yahoo', crashstart, crashend)
MDTdur['avgreturnduring'] = MDTdur['Close'].pct_change(1)
MDTdur['Cumulative Return During Crash'] = (1 + MDTdur['avgreturnduring']).cumprod()
#period after crash
MDTaft = web.DataReader('MDT', 'yahoo', crashend, end)
MDTaft['avgreturnafter'] = MDTaft['Close'].pct_change(1)
MDTaft['Cumulative Return After Crash'] = (1 + MDTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MRK = web.DataReader('MRK', 'yahoo', start, end)
MRK['returns'] = MRK['Close'].pct_change(1)
MRK['Cumulative Return'] = (1 + MRK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MRKmean = MRK['returns'].mean()
MRKvar = MRK['returns'].var()
MRKkurt = MRK['returns'].kurt()
MRKskew = MRK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MRKbef = web.DataReader('MRK', 'yahoo', start, crashstart)
MRKbef['avgreturnbefore'] = MRKbef['Close'].pct_change(1)
MRKbef['Cumulative Return Before Crash'] = (1 + MRKbef['avgreturnbefore']).cumprod()
#period of crash
MRKdur = web.DataReader('MRK', 'yahoo', crashstart, crashend)
MRKdur['avgreturnduring'] = MRKdur['Close'].pct_change(1)
MRKdur['Cumulative Return During Crash'] = (1 + MRKdur['avgreturnduring']).cumprod()
#period after crash
MRKaft = web.DataReader('MRK', 'yahoo', crashend, end)
MRKaft['avgreturnafter'] = MRKaft['Close'].pct_change(1)
MRKaft['Cumulative Return After Crash'] = (1 + MRKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MTD = web.DataReader('MTD', 'yahoo', start, end)
MTD['returns'] = MTD['Close'].pct_change(1)
MTD['Cumulative Return'] = (1 + MTD['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MTDmean = MTD['returns'].mean()
MTDvar = MTD['returns'].var()
MTDkurt = MTD['returns'].kurt()
MTDskew = MTD['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MTDbef = web.DataReader('MTD', 'yahoo', start, crashstart)
MTDbef['avgreturnbefore'] = MTDbef['Close'].pct_change(1)
MTDbef['Cumulative Return Before Crash'] = (1 + MTDbef['avgreturnbefore']).cumprod()
#period of crash
MTDdur = web.DataReader('MTD', 'yahoo', crashstart, crashend)
MTDdur['avgreturnduring'] = MTDdur['Close'].pct_change(1)
MTDdur['Cumulative Return During Crash'] = (1 + MTDdur['avgreturnduring']).cumprod()
#period after crash
MTDaft = web.DataReader('MTD', 'yahoo', crashend, end)
MTDaft['avgreturnafter'] = MTDaft['Close'].pct_change(1)
MTDaft['Cumulative Return After Crash'] = (1 + MTDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MYL = web.DataReader('MYL', 'yahoo', start, end)
MYL['returns'] = MYL['Close'].pct_change(1)
MYL['Cumulative Return'] = (1 + MYL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MYLmean = MYL['returns'].mean()
MYLvar = MYL['returns'].var()
MYLkurt = MYL['returns'].kurt()
MYLskew = MYL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MYLbef = web.DataReader('MYL', 'yahoo', start, crashstart)
MYLbef['avgreturnbefore'] = MYLbef['Close'].pct_change(1)
MYLbef['Cumulative Return Before Crash'] = (1 + MYLbef['avgreturnbefore']).cumprod()
#period of crash
MYLdur = web.DataReader('MYL', 'yahoo', crashstart, crashend)
MYLdur['avgreturnduring'] = MYLdur['Close'].pct_change(1)
MYLdur['Cumulative Return During Crash'] = (1 + MYLdur['avgreturnduring']).cumprod()
#period after crash
MYLaft = web.DataReader('MYL', 'yahoo', crashend, end)
MYLaft['avgreturnafter'] = MYLaft['Close'].pct_change(1)
MYLaft['Cumulative Return After Crash'] = (1 + MYLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PKI = web.DataReader('PKI', 'yahoo', start, end)
PKI['returns'] = PKI['Close'].pct_change(1)
PKI['Cumulative Return'] = (1 + PKI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PKImean = PKI['returns'].mean()
PKIvar = PKI['returns'].var()
PKIkurt = PKI['returns'].kurt()
PKIskew = PKI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PKIbef = web.DataReader('PKI', 'yahoo', start, crashstart)
PKIbef['avgreturnbefore'] = PKIbef['Close'].pct_change(1)
PKIbef['Cumulative Return Before Crash'] = (1 + PKIbef['avgreturnbefore']).cumprod()
#period of crash
PKIdur = web.DataReader('PKI', 'yahoo', crashstart, crashend)
PKIdur['avgreturnduring'] = PKIdur['Close'].pct_change(1)
PKIdur['Cumulative Return During Crash'] = (1 + PKIdur['avgreturnduring']).cumprod()
#period after crash
PKIaft = web.DataReader('PKI', 'yahoo', crashend, end)
PKIaft['avgreturnafter'] = PKIaft['Close'].pct_change(1)
PKIaft['Cumulative Return After Crash'] = (1 + PKIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PRGO = web.DataReader('PRGO', 'yahoo', start, end)
PRGO['returns'] = PRGO['Close'].pct_change(1)
PRGO['Cumulative Return'] = (1 + PRGO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PRGOmean = PRGO['returns'].mean()
PRGOvar = PRGO['returns'].var()
PRGOkurt = PRGO['returns'].kurt()
PRGOskew = PRGO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PRGObef = web.DataReader('PRGO', 'yahoo', start, crashstart)
PRGObef['avgreturnbefore'] = PRGObef['Close'].pct_change(1)
PRGObef['Cumulative Return Before Crash'] = (1 + PRGObef['avgreturnbefore']).cumprod()
#period of crash
PRGOdur = web.DataReader('PRGO', 'yahoo', crashstart, crashend)
PRGOdur['avgreturnduring'] = PRGOdur['Close'].pct_change(1)
PRGOdur['Cumulative Return During Crash'] = (1 + PRGOdur['avgreturnduring']).cumprod()
#period after crash
PRGOaft = web.DataReader('PRGO', 'yahoo', crashend, end)
PRGOaft['avgreturnafter'] = PRGOaft['Close'].pct_change(1)
PRGOaft['Cumulative Return After Crash'] = (1 + PRGOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PFE = web.DataReader('PFE', 'yahoo', start, end)
PFE['returns'] = PFE['Close'].pct_change(1)
PFE['Cumulative Return'] = (1 + PFE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PFEmean = PFE['returns'].mean()
PFEvar = PFE['returns'].var()
PFEkurt = PFE['returns'].kurt()
PFEskew = PFE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PFEbef = web.DataReader('PFE', 'yahoo', start, crashstart)
PFEbef['avgreturnbefore'] = PFEbef['Close'].pct_change(1)
PFEbef['Cumulative Return Before Crash'] = (1 + PFEbef['avgreturnbefore']).cumprod()
#period of crash
PFEdur = web.DataReader('PFE', 'yahoo', crashstart, crashend)
PFEdur['avgreturnduring'] = PFEdur['Close'].pct_change(1)
PFEdur['Cumulative Return During Crash'] = (1 + PFEdur['avgreturnduring']).cumprod()
#period after crash
PFEaft = web.DataReader('PFE', 'yahoo', crashend, end)
PFEaft['avgreturnafter'] = PFEaft['Close'].pct_change(1)
PFEaft['Cumulative Return After Crash'] = (1 + PFEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DGX = web.DataReader('DGX', 'yahoo', start, end)
DGX['returns'] = DGX['Close'].pct_change(1)
DGX['Cumulative Return'] = (1 + DGX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DGXmean = DGX['returns'].mean()
DGXvar = DGX['returns'].var()
DGXkurt = DGX['returns'].kurt()
DGXskew = DGX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DGXbef = web.DataReader('DGX', 'yahoo', start, crashstart)
DGXbef['avgreturnbefore'] = DGXbef['Close'].pct_change(1)
DGXbef['Cumulative Return Before Crash'] = (1 + DGXbef['avgreturnbefore']).cumprod()
#period of crash
DGXdur = web.DataReader('DGX', 'yahoo', crashstart, crashend)
DGXdur['avgreturnduring'] = DGXdur['Close'].pct_change(1)
DGXdur['Cumulative Return During Crash'] = (1 + DGXdur['avgreturnduring']).cumprod()
#period after crash
DGXaft = web.DataReader('DGX', 'yahoo', crashend, end)
DGXaft['avgreturnafter'] = DGXaft['Close'].pct_change(1)
DGXaft['Cumulative Return After Crash'] = (1 + DGXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
REGN = web.DataReader('REGN', 'yahoo', start, end)
REGN['returns'] = REGN['Close'].pct_change(1)
REGN['Cumulative Return'] = (1 + REGN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
REGNmean = REGN['returns'].mean()
REGNvar = REGN['returns'].var()
REGNkurt = REGN['returns'].kurt()
REGNskew = REGN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
REGNbef = web.DataReader('REGN', 'yahoo', start, crashstart)
REGNbef['avgreturnbefore'] = REGNbef['Close'].pct_change(1)
REGNbef['Cumulative Return Before Crash'] = (1 + REGNbef['avgreturnbefore']).cumprod()
#period of crash
REGNdur = web.DataReader('REGN', 'yahoo', crashstart, crashend)
REGNdur['avgreturnduring'] = REGNdur['Close'].pct_change(1)
REGNdur['Cumulative Return During Crash'] = (1 + REGNdur['avgreturnduring']).cumprod()
#period after crash
REGNaft = web.DataReader('REGN', 'yahoo', crashend, end)
REGNaft['avgreturnafter'] = REGNaft['Close'].pct_change(1)
REGNaft['Cumulative Return After Crash'] = (1 + REGNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
RMD = web.DataReader('RMD', 'yahoo', start, end)
RMD['returns'] = RMD['Close'].pct_change(1)
RMD['Cumulative Return'] = (1 + RMD['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
RMDmean = RMD['returns'].mean()
RMDvar = RMD['returns'].var()
RMDkurt = RMD['returns'].kurt()
RMDskew = RMD['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
RMDbef = web.DataReader('RMD', 'yahoo', start, crashstart)
RMDbef['avgreturnbefore'] = RMDbef['Close'].pct_change(1)
RMDbef['Cumulative Return Before Crash'] = (1 + RMDbef['avgreturnbefore']).cumprod()
#period of crash
RMDdur = web.DataReader('RMD', 'yahoo', crashstart, crashend)
RMDdur['avgreturnduring'] = RMDdur['Close'].pct_change(1)
RMDdur['Cumulative Return During Crash'] = (1 + RMDdur['avgreturnduring']).cumprod()
#period after crash
RMDaft = web.DataReader('RMD', 'yahoo', crashend, end)
RMDaft['avgreturnafter'] = RMDaft['Close'].pct_change(1)
RMDaft['Cumulative Return After Crash'] = (1 + RMDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
STE = web.DataReader('STE', 'yahoo', start, end)
STE['returns'] = STE['Close'].pct_change(1)
STE['Cumulative Return'] = (1 + STE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
STEmean = STE['returns'].mean()
STEvar = STE['returns'].var()
STEkurt = STE['returns'].kurt()
STEskew = STE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
STEbef = web.DataReader('STE', 'yahoo', start, crashstart)
STEbef['avgreturnbefore'] = STEbef['Close'].pct_change(1)
STEbef['Cumulative Return Before Crash'] = (1 + STEbef['avgreturnbefore']).cumprod()
#period of crash
STEdur = web.DataReader('STE', 'yahoo', crashstart, crashend)
STEdur['avgreturnduring'] = STEdur['Close'].pct_change(1)
STEdur['Cumulative Return During Crash'] = (1 + STEdur['avgreturnduring']).cumprod()
#period after crash
STEaft = web.DataReader('STE', 'yahoo', crashend, end)
STEaft['avgreturnafter'] = STEaft['Close'].pct_change(1)
STEaft['Cumulative Return After Crash'] = (1 + STEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SYK = web.DataReader('SYK', 'yahoo', start, end)
SYK['returns'] = SYK['Close'].pct_change(1)
SYK['Cumulative Return'] = (1 + SYK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SYKmean = SYK['returns'].mean()
SYKvar = SYK['returns'].var()
SYKkurt = SYK['returns'].kurt()
SYKskew = SYK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SYKbef = web.DataReader('SYK', 'yahoo', start, crashstart)
SYKbef['avgreturnbefore'] = SYKbef['Close'].pct_change(1)
SYKbef['Cumulative Return Before Crash'] = (1 + SYKbef['avgreturnbefore']).cumprod()
#period of crash
SYKdur = web.DataReader('SYK', 'yahoo', crashstart, crashend)
SYKdur['avgreturnduring'] = SYKdur['Close'].pct_change(1)
SYKdur['Cumulative Return During Crash'] = (1 + SYKdur['avgreturnduring']).cumprod()
#period after crash
SYKaft = web.DataReader('SYK', 'yahoo', crashend, end)
SYKaft['avgreturnafter'] = SYKaft['Close'].pct_change(1)
SYKaft['Cumulative Return After Crash'] = (1 + SYKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TFX = web.DataReader('TFX', 'yahoo', start, end)
TFX['returns'] = TFX['Close'].pct_change(1)
TFX['Cumulative Return'] = (1 + TFX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TFXmean = TFX['returns'].mean()
TFXvar = TFX['returns'].var()
TFXkurt = TFX['returns'].kurt()
TFXskew = TFX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TFXbef = web.DataReader('TFX', 'yahoo', start, crashstart)
TFXbef['avgreturnbefore'] = TFXbef['Close'].pct_change(1)
TFXbef['Cumulative Return Before Crash'] = (1 + TFXbef['avgreturnbefore']).cumprod()
#period of crash
TFXdur = web.DataReader('TFX', 'yahoo', crashstart, crashend)
TFXdur['avgreturnduring'] = TFXdur['Close'].pct_change(1)
TFXdur['Cumulative Return During Crash'] = (1 + TFXdur['avgreturnduring']).cumprod()
#period after crash
TFXaft = web.DataReader('TFX', 'yahoo', crashend, end)
TFXaft['avgreturnafter'] = TFXaft['Close'].pct_change(1)
TFXaft['Cumulative Return After Crash'] = (1 + TFXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TMO = web.DataReader('TMO', 'yahoo', start, end)
TMO['returns'] = TMO['Close'].pct_change(1)
TMO['Cumulative Return'] = (1 + TMO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TMOmean = TMO['returns'].mean()
TMOvar = TMO['returns'].var()
TMOkurt = TMO['returns'].kurt()
TMOskew = TMO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TMObef = web.DataReader('TMO', 'yahoo', start, crashstart)
TMObef['avgreturnbefore'] = TMObef['Close'].pct_change(1)
TMObef['Cumulative Return Before Crash'] = (1 + TMObef['avgreturnbefore']).cumprod()
#period of crash
TMOdur = web.DataReader('TMO', 'yahoo', crashstart, crashend)
TMOdur['avgreturnduring'] = TMOdur['Close'].pct_change(1)
TMOdur['Cumulative Return During Crash'] = (1 + TMOdur['avgreturnduring']).cumprod()
#period after crash
TMOaft = web.DataReader('TMO', 'yahoo', crashend, end)
TMOaft['avgreturnafter'] = TMOaft['Close'].pct_change(1)
TMOaft['Cumulative Return After Crash'] = (1 + TMOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
UNH = web.DataReader('UNH', 'yahoo', start, end)
UNH['returns'] = UNH['Close'].pct_change(1)
UNH['Cumulative Return'] = (1 + UNH['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
UNHmean = UNH['returns'].mean()
UNHvar = UNH['returns'].var()
UNHkurt = UNH['returns'].kurt()
UNHskew = UNH['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
UNHbef = web.DataReader('UNH', 'yahoo', start, crashstart)
UNHbef['avgreturnbefore'] = UNHbef['Close'].pct_change(1)
UNHbef['Cumulative Return Before Crash'] = (1 + UNHbef['avgreturnbefore']).cumprod()
#period of crash
UNHdur = web.DataReader('UNH', 'yahoo', crashstart, crashend)
UNHdur['avgreturnduring'] = UNHdur['Close'].pct_change(1)
UNHdur['Cumulative Return During Crash'] = (1 + UNHdur['avgreturnduring']).cumprod()
#period after crash
UNHaft = web.DataReader('UNH', 'yahoo', crashend, end)
UNHaft['avgreturnafter'] = UNHaft['Close'].pct_change(1)
UNHaft['Cumulative Return After Crash'] = (1 + UNHaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
UHS = web.DataReader('UHS', 'yahoo', start, end)
UHS['returns'] = UHS['Close'].pct_change(1)
UHS['Cumulative Return'] = (1 + UHS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
UHSmean = UHS['returns'].mean()
UHSvar = UHS['returns'].var()
UHSkurt = UHS['returns'].kurt()
UHSskew = UHS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
UHSbef = web.DataReader('UHS', 'yahoo', start, crashstart)
UHSbef['avgreturnbefore'] = UHSbef['Close'].pct_change(1)
UHSbef['Cumulative Return Before Crash'] = (1 + UHSbef['avgreturnbefore']).cumprod()
#period of crash
UHSdur = web.DataReader('UHS', 'yahoo', crashstart, crashend)
UHSdur['avgreturnduring'] = UHSdur['Close'].pct_change(1)
UHSdur['Cumulative Return During Crash'] = (1 + UHSdur['avgreturnduring']).cumprod()
#period after crash
UHSaft = web.DataReader('UHS', 'yahoo', crashend, end)
UHSaft['avgreturnafter'] = UHSaft['Close'].pct_change(1)
UHSaft['Cumulative Return After Crash'] = (1 + UHSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
VAR = web.DataReader('VAR', 'yahoo', start, end)
VAR['returns'] = VAR['Close'].pct_change(1)
VAR['Cumulative Return'] = (1 + VAR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
VARmean = VAR['returns'].mean()
VARvar = VAR['returns'].var()
VARkurt = VAR['returns'].kurt()
VARskew = VAR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
VARbef = web.DataReader('VAR', 'yahoo', start, crashstart)
VARbef['avgreturnbefore'] = VARbef['Close'].pct_change(1)
VARbef['Cumulative Return Before Crash'] = (1 + VARbef['avgreturnbefore']).cumprod()
#period of crash
VARdur = web.DataReader('VAR', 'yahoo', crashstart, crashend)
VARdur['avgreturnduring'] = VARdur['Close'].pct_change(1)
VARdur['Cumulative Return During Crash'] = (1 + VARdur['avgreturnduring']).cumprod()
#period after crash
VARaft = web.DataReader('VAR', 'yahoo', crashend, end)
VARaft['avgreturnafter'] = VARaft['Close'].pct_change(1)
VARaft['Cumulative Return After Crash'] = (1 + VARaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
VRTX = web.DataReader('VRTX', 'yahoo', start, end)
VRTX['returns'] = VRTX['Close'].pct_change(1)
VRTX['Cumulative Return'] = (1 + VRTX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
VRTXmean = VRTX['returns'].mean()
VRTXvar = VRTX['returns'].var()
VRTXkurt = VRTX['returns'].kurt()
VRTXskew = VRTX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
VRTXbef = web.DataReader('VRTX', 'yahoo', start, crashstart)
VRTXbef['avgreturnbefore'] = VRTXbef['Close'].pct_change(1)
VRTXbef['Cumulative Return Before Crash'] = (1 + VRTXbef['avgreturnbefore']).cumprod()
#period of crash
VRTXdur = web.DataReader('VRTX', 'yahoo', crashstart, crashend)
VRTXdur['avgreturnduring'] = VRTXdur['Close'].pct_change(1)
VRTXdur['Cumulative Return During Crash'] = (1 + VRTXdur['avgreturnduring']).cumprod()
#period after crash
VRTXaft = web.DataReader('VRTX', 'yahoo', crashend, end)
VRTXaft['avgreturnafter'] = VRTXaft['Close'].pct_change(1)
VRTXaft['Cumulative Return After Crash'] = (1 + VRTXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WAT = web.DataReader('WAT', 'yahoo', start, end)
WAT['returns'] = WAT['Close'].pct_change(1)
WAT['Cumulative Return'] = (1 + WAT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WATmean = WAT['returns'].mean()
WATvar = WAT['returns'].var()
WATkurt = WAT['returns'].kurt()
WATskew = WAT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WATbef = web.DataReader('WAT', 'yahoo', start, crashstart)
WATbef['avgreturnbefore'] = WATbef['Close'].pct_change(1)
WATbef['Cumulative Return Before Crash'] = (1 + WATbef['avgreturnbefore']).cumprod()
#period of crash
WATdur = web.DataReader('WAT', 'yahoo', crashstart, crashend)
WATdur['avgreturnduring'] = WATdur['Close'].pct_change(1)
WATdur['Cumulative Return During Crash'] = (1 + WATdur['avgreturnduring']).cumprod()
#period after crash
WATaft = web.DataReader('WAT', 'yahoo', crashend, end)
WATaft['avgreturnafter'] = WATaft['Close'].pct_change(1)
WATaft['Cumulative Return After Crash'] = (1 + WATaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WST = web.DataReader('WST', 'yahoo', start, end)
WST['returns'] = WST['Close'].pct_change(1)
WST['Cumulative Return'] = (1 + WST['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WSTmean = WST['returns'].mean()
WSTvar = WST['returns'].var()
WSTkurt = WST['returns'].kurt()
WSTskew = WST['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WSTbef = web.DataReader('WST', 'yahoo', start, crashstart)
WSTbef['avgreturnbefore'] = WSTbef['Close'].pct_change(1)
WSTbef['Cumulative Return Before Crash'] = (1 + WSTbef['avgreturnbefore']).cumprod()
#period of crash
WSTdur = web.DataReader('WST', 'yahoo', crashstart, crashend)
WSTdur['avgreturnduring'] = WSTdur['Close'].pct_change(1)
WSTdur['Cumulative Return During Crash'] = (1 + WSTdur['avgreturnduring']).cumprod()
#period after crash
WSTaft = web.DataReader('WST', 'yahoo', crashend, end)
WSTaft['avgreturnafter'] = WSTaft['Close'].pct_change(1)
WSTaft['Cumulative Return After Crash'] = (1 + WSTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ZBH = web.DataReader('ZBH', 'yahoo', start, end)
ZBH['returns'] = ZBH['Close'].pct_change(1)
ZBH['Cumulative Return'] = (1 + ZBH['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ZBHmean = ZBH['returns'].mean()
ZBHvar = ZBH['returns'].var()
ZBHkurt = ZBH['returns'].kurt()
ZBHskew = ZBH['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ZBHbef = web.DataReader('ZBH', 'yahoo', start, crashstart)
ZBHbef['avgreturnbefore'] = ZBHbef['Close'].pct_change(1)
ZBHbef['Cumulative Return Before Crash'] = (1 + ZBHbef['avgreturnbefore']).cumprod()
#period of crash
ZBHdur = web.DataReader('ZBH', 'yahoo', crashstart, crashend)
ZBHdur['avgreturnduring'] = ZBHdur['Close'].pct_change(1)
ZBHdur['Cumulative Return During Crash'] = (1 + ZBHdur['avgreturnduring']).cumprod()
#period after crash
ZBHaft = web.DataReader('ZBH', 'yahoo', crashend, end)
ZBHaft['avgreturnafter'] = ZBHaft['Close'].pct_change(1)
ZBHaft['Cumulative Return After Crash'] = (1 + ZBHaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ZTS = web.DataReader('ZTS', 'yahoo', start, end)
ZTS['returns'] = ZTS['Close'].pct_change(1)
ZTS['Cumulative Return'] = (1 + ZTS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ZTSmean = ZTS['returns'].mean()
ZTSvar = ZTS['returns'].var()
ZTSkurt = ZTS['returns'].kurt()
ZTSskew = ZTS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ZTSbef = web.DataReader('ZTS', 'yahoo', start, crashstart)
ZTSbef['avgreturnbefore'] = ZTSbef['Close'].pct_change(1)
ZTSbef['Cumulative Return Before Crash'] = (1 + ZTSbef['avgreturnbefore']).cumprod()
#period of crash
ZTSdur = web.DataReader('ZTS', 'yahoo', crashstart, crashend)
ZTSdur['avgreturnduring'] = ZTSdur['Close'].pct_change(1)
ZTSdur['Cumulative Return During Crash'] = (1 + ZTSdur['avgreturnduring']).cumprod()
#period after crash
ZTSaft = web.DataReader('ZTS', 'yahoo', crashend, end)
ZTSaft['avgreturnafter'] = ZTSaft['Close'].pct_change(1)
ZTSaft['Cumulative Return After Crash'] = (1 + ZTSaft['avgreturnafter']).cumprod()
#KDE Plot for Healthcare Sector
sp['returns'].plot(kind = 'kde', label ='S&P 500', alpha=0.5)
ABT['returns'].plot(kind = 'kde', label ='ABT', figsize = (10,8), alpha=0.5, title = 'KDE of Healthcare Stocks')
ABBV['returns'].plot(kind = 'kde', label ='ABBV', alpha=0.5)
ABMD['returns'].plot(kind = 'kde', label ='ABMD', alpha=0.5)
A['returns'].plot(kind = 'kde', label ='A', alpha=0.5)
ALXN['returns'].plot(kind = 'kde', label ='ALXN', alpha=0.5)
ALGN['returns'].plot(kind = 'kde', label ='ALGN', alpha=0.5)
ABC['returns'].plot(kind = 'kde', label ='ABC', alpha=0.5)
AMGN['returns'].plot(kind = 'kde', label ='AMGN', alpha=0.5)
ANTM['returns'].plot(kind = 'kde', label ='ANTM', alpha=0.5)
BAX['returns'].plot(kind = 'kde', label ='BAX', alpha=0.5)
BDX['returns'].plot(kind = 'kde', label ='BDX', alpha=0.5)
BIIB['returns'].plot(kind = 'kde', label ='BIIB', alpha=0.5)
BSX['returns'].plot(kind = 'kde', label ='BSX', alpha=0.5)
BMY['returns'].plot(kind = 'kde', label ='BMY', alpha=0.5)
CAH['returns'].plot(kind = 'kde', label = 'CAH', alpha=0.5)
CNC['returns'].plot(kind = 'kde', label ='CNC', alpha=0.5)
CERN['returns'].plot(kind = 'kde', label ='CERN', alpha=0.5)
CI['returns'].plot(kind = 'kde', label ='CI', alpha=0.5)
COO['returns'].plot(kind = 'kde', label ='COO', alpha=0.5)
CVS['returns'].plot(kind = 'kde', label ='CVS', alpha=0.5)
DHR['returns'].plot(kind = 'kde', label ='DHR', alpha=0.5)
DVA['returns'].plot(kind = 'kde', label ='DVA', alpha=0.5)
XRAY['returns'].plot(kind = 'kde', label ='XRAY', alpha=0.5)
DXCM['returns'].plot(kind = 'kde', label ='DXCM', alpha=0.5)
EW['returns'].plot(kind = 'kde', label ='EW', alpha=0.5)
GILD['returns'].plot(kind = 'kde', label ='GILD', alpha=0.5)
HCA['returns'].plot(kind = 'kde', label ='HCA', alpha=0.5)
HSIC['returns'].plot(kind = 'kde', label ='HSIC', alpha=0.5)
HOLX['returns'].plot(kind = 'kde', label ='HOLX', alpha=0.5)
HUM['returns'].plot(kind = 'kde', label ='HUM', alpha=0.5)
IDXX['returns'].plot(kind = 'kde', label ='IDXX', alpha=0.5)
ILMN['returns'].plot(kind = 'kde', label ='ILMN', alpha=0.5)
INCY['returns'].plot(kind = 'kde', label ='INCY', alpha=0.5)
ISRG['returns'].plot(kind = 'kde', label ='ISRG', alpha=0.5)
IQV['returns'].plot(kind = 'kde', label ='IQV', alpha=0.5)
JNJ['returns'].plot(kind = 'kde', label ='JNJ', alpha=0.5)
LH['returns'].plot(kind = 'kde', label ='LH', alpha=0.5)
LLY['returns'].plot(kind = 'kde', label ='LLY', alpha=0.5)
MCK['returns'].plot(kind = 'kde', label ='MCK', alpha=0.5)
MDT['returns'].plot(kind = 'kde', label ='MDT', alpha=0.5)
MRK['returns'].plot(kind = 'kde', label ='MRK', alpha=0.5)
MTD['returns'].plot(kind = 'kde', label ='MTD', alpha=0.5)
MYL['returns'].plot(kind = 'kde', label ='MYL', alpha=0.5)
PKI['returns'].plot(kind = 'kde', label ='PKI', alpha=0.5)
PRGO['returns'].plot(kind = 'kde', label ='PRGO', alpha=0.5)
PFE['returns'].plot(kind = 'kde', label ='PFE', alpha=0.5)
DGX['returns'].plot(kind = 'kde', label ='DGX', alpha=0.5)
REGN['returns'].plot(kind = 'kde', label ='REGN', alpha=0.5)
RMD['returns'].plot(kind = 'kde', label ='RMD', alpha=0.5)
STE['returns'].plot(kind = 'kde', label ='STE', alpha=0.5)
SYK['returns'].plot(kind = 'kde', label ='SYK', alpha=0.5)
TFX['returns'].plot(kind = 'kde', label ='TFX', alpha=0.5)
TMO['returns'].plot(kind = 'kde', label ='TMO', alpha=0.5)
UNH['returns'].plot(kind = 'kde', label ='UNH', alpha=0.5)
UHS['returns'].plot(kind = 'kde', label ='UHS', alpha=0.5)
VAR['returns'].plot(kind = 'kde', label ='VAR', alpha=0.5)
VRTX['returns'].plot(kind = 'kde', label ='VRTX', alpha=0.5)
WAT['returns'].plot(kind = 'kde', label ='WAT', alpha=0.5)
WST['returns'].plot(kind = 'kde', label ='WST', alpha=0.5)
ZBH['returns'].plot(kind = 'kde', label ='ZBH', alpha=0.5)
ZTS['returns'].plot(kind = 'kde', label ='ZTS', alpha=0.5)
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Boxplots comparing returns for Healthcare Sector
box_df = pd.concat([sp['returns'],ABT['returns'],ABBV['returns'],ABMD['returns'],A['returns'],ALXN['returns'],ALGN['returns'],ABC['returns'],AMGN['returns'],ANTM['returns'],BAX['returns'],BDX['returns'],BIIB['returns'],BSX['returns'],BMY['returns'],CAH['returns'],CNC['returns'],CERN['returns'],CI['returns'],COO['returns'],CVS['returns'],DHR['returns'],DVA['returns'],XRAY['returns'],DXCM['returns'],EW['returns'],GILD['returns'],HCA['returns'],HSIC['returns'],HOLX['returns'],HUM['returns'],IDXX['returns'],ILMN['returns'],INCY['returns'],ISRG['returns'],IQV['returns'],JNJ['returns'],LH['returns'],LLY['returns'],MCK['returns'],MDT['returns'],MRK['returns'],MTD['returns'],MYL['returns'],PKI['returns'],PRGO['returns'],PFE['returns'],DGX['returns'],REGN['returns'],RMD['returns'],STE['returns'],SYK['returns'],TFX['returns'],TMO['returns'],UNH['returns'],UHS['returns'],VAR['returns'],VRTX['returns'],WAT['returns'],WST['returns'],ZBH['returns'],ZTS['returns']], axis=1)
box_df.columns = ['S&P 500','ABT','ABBV','ABMD','A','ALXN','ALGN','ABC','AMGN','ANTM','BAX','BDX','BIIB','BSX','BMY','CAH','CNC','CERN','CI','COO','CVS','DHR','DVA','XRAY','DXCM','EW','GILD','HCA','HSIC','HOLX','HUM','IDXX','ILMN','INCY','ISRG','IQV','JNJ','LH','LLY','MCK','MDT','MRK','MTD','MYL','PKI','PRGO','PFE','DGX','REGN','RMD','STE','SYK','TFX','TMO','UNH','UHS','VAR','VRTX','WAT','WST','ZBH','ZTS']
box_df.plot(kind='box', figsize=(30,10), colormap= 'jet', title = 'Boxplots of Healthcare Sector Returns')
#Cumulative Returns of Healthcare Stocks for Whole period
sp['Cumulative Return'].plot(label="S&P 500")
ABT['Cumulative Return'].plot(label='ABT', figsize=(16,8), title = 'Cumulative Return of Healthcare Stocks')
ABBV['Cumulative Return'].plot(label="ABBV")
ABMD['Cumulative Return'].plot(label="ABMD")
A['Cumulative Return'].plot(label="A")
ALXN['Cumulative Return'].plot(label="ALXN")
ALGN['Cumulative Return'].plot(label="ALGN")
ABC['Cumulative Return'].plot(label="ABC")
AMGN['Cumulative Return'].plot(label="AMGN")
ANTM['Cumulative Return'].plot(label="ANTM")
BAX['Cumulative Return'].plot(label="BAX")
BDX['Cumulative Return'].plot(label="BDX")
BIIB['Cumulative Return'].plot(label="BIIB")
BSX['Cumulative Return'].plot(label="BSX")
BMY['Cumulative Return'].plot(label="BMY")
CAH['Cumulative Return'].plot(label="CAH")
CNC['Cumulative Return'].plot(label="CNC")
CERN['Cumulative Return'].plot(label="CERN")
CI['Cumulative Return'].plot(label="CI")
COO['Cumulative Return'].plot(label="COO")
CVS['Cumulative Return'].plot(label="CVS")
DHR['Cumulative Return'].plot(label="DHR")
DVA['Cumulative Return'].plot(label="DVA")
XRAY['Cumulative Return'].plot(label="XRAY")
DXCM['Cumulative Return'].plot(label="DXCM")
EW['Cumulative Return'].plot(label="EW")
GILD['Cumulative Return'].plot(label="GILD")
HCA['Cumulative Return'].plot(label="HCA")
HSIC['Cumulative Return'].plot(label="HSIC")
HOLX['Cumulative Return'].plot(label="HOLX")
HUM['Cumulative Return'].plot(label="HUM")
IDXX['Cumulative Return'].plot(label="IDXX")
ILMN['Cumulative Return'].plot(label="ILMN")
INCY['Cumulative Return'].plot(label="INCY")
ISRG['Cumulative Return'].plot(label="ISRG")
IQV['Cumulative Return'].plot(label="IQV")
JNJ['Cumulative Return'].plot(label="JNJ")
LH['Cumulative Return'].plot(label="LH")
LLY['Cumulative Return'].plot(label="LLY")
MCK['Cumulative Return'].plot(label="MCK")
MDT['Cumulative Return'].plot(label="MDT")
MRK['Cumulative Return'].plot(label="MRK")
MTD['Cumulative Return'].plot(label="MTD")
MYL['Cumulative Return'].plot(label="MYL")
PKI['Cumulative Return'].plot(label="PKI")
PRGO['Cumulative Return'].plot(label="PRGO")
PFE['Cumulative Return'].plot(label="PFE")
DGX['Cumulative Return'].plot(label="DGX")
REGN['Cumulative Return'].plot(label="REGN")
RMD['Cumulative Return'].plot(label="RMD")
STE['Cumulative Return'].plot(label="STE")
SYK['Cumulative Return'].plot(label="SYK")
TFX['Cumulative Return'].plot(label="TFX")
TMO['Cumulative Return'].plot(label="TMO")
UNH['Cumulative Return'].plot(label="UNH")
UHS['Cumulative Return'].plot(label="UHS")
VAR['Cumulative Return'].plot(label="VAR")
VRTX['Cumulative Return'].plot(label="VRTX")
WAT['Cumulative Return'].plot(label="WAT")
WST['Cumulative Return'].plot(label="WST")
ZBH['Cumulative Return'].plot(label="ZBH")
ZTS['Cumulative Return'].plot(label="ZTS")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Sorting by Cumulative Return
cumret = {'Cumulative Returns 12/4-6/5': [sp['Cumulative Return'].iloc[-1],ABT['Cumulative Return'].iloc[-1],ABBV['Cumulative Return'].iloc[-1],ABMD['Cumulative Return'].iloc[-1],A['Cumulative Return'].iloc[-1],ALXN['Cumulative Return'].iloc[-1],ALGN['Cumulative Return'].iloc[-1],ABC['Cumulative Return'].iloc[-1],AMGN['Cumulative Return'].iloc[-1],ANTM['Cumulative Return'].iloc[-1],BAX['Cumulative Return'].iloc[-1],BDX['Cumulative Return'].iloc[-1],BIIB['Cumulative Return'].iloc[-1],BSX['Cumulative Return'].iloc[-1],BMY['Cumulative Return'].iloc[-1],CAH['Cumulative Return'].iloc[-1],CNC['Cumulative Return'].iloc[-1],CERN['Cumulative Return'].iloc[-1],CI['Cumulative Return'].iloc[-1],COO['Cumulative Return'].iloc[-1],CVS['Cumulative Return'].iloc[-1],DHR['Cumulative Return'].iloc[-1],DVA['Cumulative Return'].iloc[-1],XRAY['Cumulative Return'].iloc[-1],DXCM['Cumulative Return'].iloc[-1],EW['Cumulative Return'].iloc[-1],GILD['Cumulative Return'].iloc[-1],HCA['Cumulative Return'].iloc[-1],HSIC['Cumulative Return'].iloc[-1],HOLX['Cumulative Return'].iloc[-1],HUM['Cumulative Return'].iloc[-1],IDXX['Cumulative Return'].iloc[-1],ILMN['Cumulative Return'].iloc[-1],INCY['Cumulative Return'].iloc[-1],ISRG['Cumulative Return'].iloc[-1],IQV['Cumulative Return'].iloc[-1],JNJ['Cumulative Return'].iloc[-1],LH['Cumulative Return'].iloc[-1],LLY['Cumulative Return'].iloc[-1],MCK['Cumulative Return'].iloc[-1],MDT['Cumulative Return'].iloc[-1],MRK['Cumulative Return'].iloc[-1],MTD['Cumulative Return'].iloc[-1],MYL['Cumulative Return'].iloc[-1],PKI['Cumulative Return'].iloc[-1],PRGO['Cumulative Return'].iloc[-1],PFE['Cumulative Return'].iloc[-1],DGX['Cumulative Return'].iloc[-1],REGN['Cumulative Return'].iloc[-1],RMD['Cumulative Return'].iloc[-1],STE['Cumulative Return'].iloc[-1],SYK['Cumulative Return'].iloc[-1],TFX['Cumulative Return'].iloc[-1],TMO['Cumulative Return'].iloc[-1],UNH['Cumulative Return'].iloc[-1],UHS['Cumulative Return'].iloc[-1],VAR['Cumulative Return'].iloc[-1],VRTX['Cumulative Return'].iloc[-1],WAT['Cumulative Return'].iloc[-1],WST['Cumulative Return'].iloc[-1],ZBH['Cumulative Return'].iloc[-1],ZTS['Cumulative Return'].iloc[-1]],
'Cumulative Returns 12/4-2/20': [spbef['Cumulative Return Before Crash'].iloc[-1],ABTbef['Cumulative Return Before Crash'].iloc[-1],ABBVbef['Cumulative Return Before Crash'].iloc[-1],ABMDbef['Cumulative Return Before Crash'].iloc[-1],Abef['Cumulative Return Before Crash'].iloc[-1],ALXNbef['Cumulative Return Before Crash'].iloc[-1],ALGNbef['Cumulative Return Before Crash'].iloc[-1],ABCbef['Cumulative Return Before Crash'].iloc[-1],AMGNbef['Cumulative Return Before Crash'].iloc[-1],ANTMbef['Cumulative Return Before Crash'].iloc[-1],BAXbef['Cumulative Return Before Crash'].iloc[-1],BDXbef['Cumulative Return Before Crash'].iloc[-1],BIIBbef['Cumulative Return Before Crash'].iloc[-1],BSXbef['Cumulative Return Before Crash'].iloc[-1],BMYbef['Cumulative Return Before Crash'].iloc[-1],CAHbef['Cumulative Return Before Crash'].iloc[-1],CNCbef['Cumulative Return Before Crash'].iloc[-1],CERNbef['Cumulative Return Before Crash'].iloc[-1],CIbef['Cumulative Return Before Crash'].iloc[-1],COObef['Cumulative Return Before Crash'].iloc[-1],CVSbef['Cumulative Return Before Crash'].iloc[-1],DHRbef['Cumulative Return Before Crash'].iloc[-1],DVAbef['Cumulative Return Before Crash'].iloc[-1],XRAYbef['Cumulative Return Before Crash'].iloc[-1],DXCMbef['Cumulative Return Before Crash'].iloc[-1],EWbef['Cumulative Return Before Crash'].iloc[-1],GILDbef['Cumulative Return Before Crash'].iloc[-1],HCAbef['Cumulative Return Before Crash'].iloc[-1],HSICbef['Cumulative Return Before Crash'].iloc[-1],HOLXbef['Cumulative Return Before Crash'].iloc[-1],HUMbef['Cumulative Return Before Crash'].iloc[-1],IDXXbef['Cumulative Return Before Crash'].iloc[-1],ILMNbef['Cumulative Return Before Crash'].iloc[-1],INCYbef['Cumulative Return Before Crash'].iloc[-1],ISRGbef['Cumulative Return Before Crash'].iloc[-1],IQVbef['Cumulative Return Before Crash'].iloc[-1],JNJbef['Cumulative Return Before Crash'].iloc[-1],LHbef['Cumulative Return Before Crash'].iloc[-1],LLYbef['Cumulative Return Before Crash'].iloc[-1],MCKbef['Cumulative Return Before Crash'].iloc[-1],MDTbef['Cumulative Return Before Crash'].iloc[-1],MRKbef['Cumulative Return Before Crash'].iloc[-1],MTDbef['Cumulative Return Before Crash'].iloc[-1],MYLbef['Cumulative Return Before Crash'].iloc[-1],PKIbef['Cumulative Return Before Crash'].iloc[-1],PRGObef['Cumulative Return Before Crash'].iloc[-1],PFEbef['Cumulative Return Before Crash'].iloc[-1],DGXbef['Cumulative Return Before Crash'].iloc[-1],REGNbef['Cumulative Return Before Crash'].iloc[-1],RMDbef['Cumulative Return Before Crash'].iloc[-1],STEbef['Cumulative Return Before Crash'].iloc[-1],SYKbef['Cumulative Return Before Crash'].iloc[-1],TFXbef['Cumulative Return Before Crash'].iloc[-1],TMObef['Cumulative Return Before Crash'].iloc[-1],UNHbef['Cumulative Return Before Crash'].iloc[-1],UHSbef['Cumulative Return Before Crash'].iloc[-1],VARbef['Cumulative Return Before Crash'].iloc[-1],VRTXbef['Cumulative Return Before Crash'].iloc[-1],WATbef['Cumulative Return Before Crash'].iloc[-1],WSTbef['Cumulative Return Before Crash'].iloc[-1],ZBHbef['Cumulative Return Before Crash'].iloc[-1],ZTSbef['Cumulative Return Before Crash'].iloc[-1]],
'Cumulative Returns 2/20-3/23': [spdur['Cumulative Return During Crash'].iloc[-1],ABTdur['Cumulative Return During Crash'].iloc[-1],ABBVdur['Cumulative Return During Crash'].iloc[-1],ABMDdur['Cumulative Return During Crash'].iloc[-1],Adur['Cumulative Return During Crash'].iloc[-1],ALXNdur['Cumulative Return During Crash'].iloc[-1],ALGNdur['Cumulative Return During Crash'].iloc[-1],ABCdur['Cumulative Return During Crash'].iloc[-1],AMGNdur['Cumulative Return During Crash'].iloc[-1],ANTMdur['Cumulative Return During Crash'].iloc[-1],BAXdur['Cumulative Return During Crash'].iloc[-1],BDXdur['Cumulative Return During Crash'].iloc[-1],BIIBdur['Cumulative Return During Crash'].iloc[-1],BSXdur['Cumulative Return During Crash'].iloc[-1],BMYdur['Cumulative Return During Crash'].iloc[-1],CAHdur['Cumulative Return During Crash'].iloc[-1],CNCdur['Cumulative Return During Crash'].iloc[-1],CERNdur['Cumulative Return During Crash'].iloc[-1],CIdur['Cumulative Return During Crash'].iloc[-1],COOdur['Cumulative Return During Crash'].iloc[-1],CVSdur['Cumulative Return During Crash'].iloc[-1],DHRdur['Cumulative Return During Crash'].iloc[-1],DVAdur['Cumulative Return During Crash'].iloc[-1],XRAYdur['Cumulative Return During Crash'].iloc[-1],DXCMdur['Cumulative Return During Crash'].iloc[-1],EWdur['Cumulative Return During Crash'].iloc[-1],GILDdur['Cumulative Return During Crash'].iloc[-1],HCAdur['Cumulative Return During Crash'].iloc[-1],HSICdur['Cumulative Return During Crash'].iloc[-1],HOLXdur['Cumulative Return During Crash'].iloc[-1],HUMdur['Cumulative Return During Crash'].iloc[-1],IDXXdur['Cumulative Return During Crash'].iloc[-1],ILMNdur['Cumulative Return During Crash'].iloc[-1],INCYdur['Cumulative Return During Crash'].iloc[-1],ISRGdur['Cumulative Return During Crash'].iloc[-1],IQVdur['Cumulative Return During Crash'].iloc[-1],JNJdur['Cumulative Return During Crash'].iloc[-1],LHdur['Cumulative Return During Crash'].iloc[-1],LLYdur['Cumulative Return During Crash'].iloc[-1],MCKdur['Cumulative Return During Crash'].iloc[-1],MDTdur['Cumulative Return During Crash'].iloc[-1],MRKdur['Cumulative Return During Crash'].iloc[-1],MTDdur['Cumulative Return During Crash'].iloc[-1],MYLdur['Cumulative Return During Crash'].iloc[-1],PKIdur['Cumulative Return During Crash'].iloc[-1],PRGOdur['Cumulative Return During Crash'].iloc[-1],PFEdur['Cumulative Return During Crash'].iloc[-1],DGXdur['Cumulative Return During Crash'].iloc[-1],REGNdur['Cumulative Return During Crash'].iloc[-1],RMDdur['Cumulative Return During Crash'].iloc[-1],STEdur['Cumulative Return During Crash'].iloc[-1],SYKdur['Cumulative Return During Crash'].iloc[-1],TFXdur['Cumulative Return During Crash'].iloc[-1],TMOdur['Cumulative Return During Crash'].iloc[-1],UNHdur['Cumulative Return During Crash'].iloc[-1],UHSdur['Cumulative Return During Crash'].iloc[-1],VARdur['Cumulative Return During Crash'].iloc[-1],VRTXdur['Cumulative Return During Crash'].iloc[-1],WATdur['Cumulative Return During Crash'].iloc[-1],WSTdur['Cumulative Return During Crash'].iloc[-1],ZBHdur['Cumulative Return During Crash'].iloc[-1],ZTSdur['Cumulative Return During Crash'].iloc[-1]],
'Cumulative Returns 3/23-6/5': [spaft['Cumulative Return After Crash'].iloc[-1],ABTaft['Cumulative Return After Crash'].iloc[-1],ABBVaft['Cumulative Return After Crash'].iloc[-1],ABMDaft['Cumulative Return After Crash'].iloc[-1],Aaft['Cumulative Return After Crash'].iloc[-1],ALXNaft['Cumulative Return After Crash'].iloc[-1],ALGNaft['Cumulative Return After Crash'].iloc[-1],ABCaft['Cumulative Return After Crash'].iloc[-1],AMGNaft['Cumulative Return After Crash'].iloc[-1],ANTMaft['Cumulative Return After Crash'].iloc[-1],BAXaft['Cumulative Return After Crash'].iloc[-1],BDXaft['Cumulative Return After Crash'].iloc[-1],BIIBaft['Cumulative Return After Crash'].iloc[-1],BSXaft['Cumulative Return After Crash'].iloc[-1],BMYaft['Cumulative Return After Crash'].iloc[-1],CAHaft['Cumulative Return After Crash'].iloc[-1],CNCaft['Cumulative Return After Crash'].iloc[-1],CERNaft['Cumulative Return After Crash'].iloc[-1],CIaft['Cumulative Return After Crash'].iloc[-1],COOaft['Cumulative Return After Crash'].iloc[-1],CVSaft['Cumulative Return After Crash'].iloc[-1],DHRaft['Cumulative Return After Crash'].iloc[-1],DVAaft['Cumulative Return After Crash'].iloc[-1],XRAYaft['Cumulative Return After Crash'].iloc[-1],DXCMaft['Cumulative Return After Crash'].iloc[-1],EWaft['Cumulative Return After Crash'].iloc[-1],GILDaft['Cumulative Return After Crash'].iloc[-1],HCAaft['Cumulative Return After Crash'].iloc[-1],HSICaft['Cumulative Return After Crash'].iloc[-1],HOLXaft['Cumulative Return After Crash'].iloc[-1],HUMaft['Cumulative Return After Crash'].iloc[-1],IDXXaft['Cumulative Return After Crash'].iloc[-1],ILMNaft['Cumulative Return After Crash'].iloc[-1],INCYaft['Cumulative Return After Crash'].iloc[-1],ISRGaft['Cumulative Return After Crash'].iloc[-1],IQVaft['Cumulative Return After Crash'].iloc[-1],JNJaft['Cumulative Return After Crash'].iloc[-1],LHaft['Cumulative Return After Crash'].iloc[-1],LLYaft['Cumulative Return After Crash'].iloc[-1],MCKaft['Cumulative Return After Crash'].iloc[-1],MDTaft['Cumulative Return After Crash'].iloc[-1],MRKaft['Cumulative Return After Crash'].iloc[-1],MTDaft['Cumulative Return After Crash'].iloc[-1],MYLaft['Cumulative Return After Crash'].iloc[-1],PKIaft['Cumulative Return After Crash'].iloc[-1],PRGOaft['Cumulative Return After Crash'].iloc[-1],PFEaft['Cumulative Return After Crash'].iloc[-1],DGXaft['Cumulative Return After Crash'].iloc[-1],REGNaft['Cumulative Return After Crash'].iloc[-1],RMDaft['Cumulative Return After Crash'].iloc[-1],STEaft['Cumulative Return After Crash'].iloc[-1],SYKaft['Cumulative Return After Crash'].iloc[-1],TFXaft['Cumulative Return After Crash'].iloc[-1],TMOaft['Cumulative Return After Crash'].iloc[-1],UNHaft['Cumulative Return After Crash'].iloc[-1],UHSaft['Cumulative Return After Crash'].iloc[-1],VARaft['Cumulative Return After Crash'].iloc[-1],VRTXaft['Cumulative Return After Crash'].iloc[-1],WATaft['Cumulative Return After Crash'].iloc[-1],WSTaft['Cumulative Return After Crash'].iloc[-1],ZBHaft['Cumulative Return After Crash'].iloc[-1],ZTSaft['Cumulative Return After Crash'].iloc[-1]]}
hdf2 = pd.DataFrame(cumret, columns = ['Cumulative Returns 12/4-6/5', 'Cumulative Returns 12/4-2/20', 'Cumulative Returns 2/20-3/23', 'Cumulative Returns 3/23-6/5'], index= ['S&P 500','ABT','ABBV','ABMD','A','ALXN','ALGN','ABC','AMGN','ANTM','BAX','BDX','BIIB','BSX','BMY','CAH','CNC','CERN','CI','COO','CVS','DHR','DVA','XRAY','DXCM','EW','GILD','HCA','HSIC','HOLX','HUM','IDXX','ILMN','INCY','ISRG','IQV','JNJ','LH','LLY','MCK','MDT','MRK','MTD','MYL','PKI','PRGO','PFE','DGX','REGN','RMD','STE','SYK','TFX','TMO','UNH','UHS','VAR','VRTX','WAT','WST','ZBH','ZTS'])
pd.DataFrame(hdf2)
hdf2.sort_values('Cumulative Returns 3/23-6/5', ascending=False)
#Table of Key Statistics of Healthcare Stocks
import pandas as pd
import statistics as stats
hmeans = [ABTmean,ABBVmean,ABMDmean,Amean,ALXNmean,ALGNmean,ABCmean,AMGNmean,ANTMmean,BAXmean,BDXmean,BIIBmean,BSXmean,BMYmean,CAHmean,CNCmean,CERNmean,CImean,COOmean,CVSmean,DHRmean,DVAmean,XRAYmean,DXCMmean,EWmean,GILDmean,HCAmean,HSICmean,HOLXmean,HUMmean,IDXXmean,ILMNmean,INCYmean,ISRGmean,IQVmean,JNJmean,LHmean,LLYmean,MCKmean,MDTmean,MRKmean,MTDmean,MYLmean,PKImean,PRGOmean,PFEmean,DGXmean,REGNmean,RMDmean,STEmean,SYKmean,TFXmean,TMOmean,UNHmean,UHSmean,VARmean,VRTXmean,WATmean,WSTmean,ZBHmean,ZTSmean]
haveragemean = stats.mean(hmeans)
hvariances = [ABTvar,ABBVvar,ABMDvar,Avar,ALXNvar,ALGNvar,ABCvar,AMGNvar,ANTMvar,BAXvar,BDXvar,BIIBvar,BSXvar,BMYvar,CAHvar,CNCvar,CERNvar,CIvar,COOvar,CVSvar,DHRvar,DVAvar,XRAYvar,DXCMvar,EWvar,GILDvar,HCAvar,HSICvar,HOLXvar,HUMvar,IDXXvar,ILMNvar,INCYvar,ISRGvar,IQVvar,JNJvar,LHvar,LLYvar,MCKvar,MDTvar,MRKvar,MTDvar,MYLvar,PKIvar,PRGOvar,PFEvar,DGXvar,REGNvar,RMDvar,STEvar,SYKvar,TFXvar,TMOvar,UNHvar,UHSvar,VARvar,VRTXvar,WATvar,WSTvar,ZBHvar,ZTSvar]
haveragevar = stats.mean(hvariances)
hkurtoses = [ABTkurt,ABBVkurt,ABMDkurt,Akurt,ALXNkurt,ALGNkurt,ABCkurt,AMGNkurt,ANTMkurt,BAXkurt,BDXkurt,BIIBkurt,BSXkurt,BMYkurt,CAHkurt,CNCkurt,CERNkurt,CIkurt,COOkurt,CVSkurt,DHRkurt,DVAkurt,XRAYkurt,DXCMkurt,EWkurt,GILDkurt,HCAkurt,HSICkurt,HOLXkurt,HUMkurt,IDXXkurt,ILMNkurt,INCYkurt,ISRGkurt,IQVkurt,JNJkurt,LHkurt,LLYkurt,MCKkurt,MDTkurt,MRKkurt,MTDkurt,MYLkurt,PKIkurt,PRGOkurt,PFEkurt,DGXkurt,REGNkurt,RMDkurt,STEkurt,SYKkurt,TFXkurt,TMOkurt,UNHkurt,UHSkurt,VARkurt,VRTXkurt,WATkurt,WSTkurt,ZBHkurt,ZTSkurt]
haveragekurt = stats.mean(hkurtoses)
hskews = [ABTskew,ABBVskew,ABMDskew,Askew,ALXNskew,ALGNskew,ABCskew,AMGNskew,ANTMskew,BAXskew,BDXskew,BIIBskew,BSXskew,BMYskew,CAHskew,CNCskew,CERNskew,CIskew,COOskew,CVSskew,DHRskew,DVAskew,XRAYskew,DXCMskew,EWskew,GILDskew,HCAskew,HSICskew,HOLXskew,HUMskew,IDXXskew,ILMNskew,INCYskew,ISRGskew,IQVskew,JNJskew,LHskew,LLYskew,MCKskew,MDTskew,MRKskew,MTDskew,MYLskew,PKIskew,PRGOskew,PFEskew,DGXskew,REGNskew,RMDskew,STEskew,SYKskew,TFXskew,TMOskew,UNHskew,UHSskew,VARskew,VRTXskew,WATskew,WSTskew,ZBHskew,ZTSskew]
haverageskew = stats.mean(hskews)
Healthcare = {'Mean': [[spmean],[haveragemean],[ABTmean], [ABBVmean],[ABMDmean],[Amean],[ALXNmean],[ALGNmean],[ABCmean],[AMGNmean],[ANTMmean],[BAXmean],[BDXmean],[BIIBmean],[BSXmean],[BMYmean],[CAHmean],[CNCmean],[CERNmean],[CImean],[COOmean],[CVSmean],[DHRmean],[DVAmean],[XRAYmean],[DXCMmean],[EWmean],[GILDmean],[HCAmean],[HSICmean],[HOLXmean],[HUMmean],[IDXXmean],[ILMNmean],[INCYmean],[ISRGmean],[IQVmean],[JNJmean],[LHmean],[LLYmean],[MCKmean],[MDTmean],[MRKmean],[MTDmean],[MYLmean],[PKImean],[PRGOmean],[PFEmean],[DGXmean],[REGNmean],[RMDmean],[STEmean],[SYKmean],[TFXmean],[TMOmean],[UNHmean],[UHSmean],[VARmean],[VRTXmean],[WATmean],[WSTmean],[ZBHmean],[ZTSmean]],
'Variance': [[spvar],[haveragevar],[ABTvar],[ABBVvar],[ABMDvar],[Avar],[ALXNvar],[ALGNvar],[ABCvar],[AMGNvar],[ANTMvar],[BAXvar],[BDXvar],[BIIBvar],[BSXvar],[BMYvar],[CAHvar],[CNCvar],[CERNvar],[CIvar],[COOvar],[CVSvar],[DHRvar],[DVAvar],[XRAYvar],[DXCMvar],[EWvar],[GILDvar],[HCAvar],[HSICvar],[HOLXvar],[HUMvar],[IDXXvar],[ILMNvar],[INCYvar],[ISRGvar],[IQVvar],[JNJvar],[LHvar],[LLYvar],[MCKvar],[MDTvar],[MRKvar],[MTDvar],[MYLvar],[PKIvar],[PRGOvar],[PFEvar],[DGXvar],[REGNvar],[RMDvar],[STEvar],[SYKvar],[TFXvar],[TMOvar],[UNHvar],[UHSvar],[VARvar],[VRTXvar],[WATvar],[WSTvar],[ZBHvar],[ZTSvar]],
'Kurtosis': [[spkurt],[haveragekurt],[ABTkurt],[ABBVkurt],[ABMDkurt],[Akurt],[ALXNkurt],[ALGNkurt],[ABCkurt],[AMGNkurt],[ANTMkurt],[BAXkurt],[BDXkurt],[BIIBkurt],[BSXkurt],[BMYkurt],[CAHkurt],[CNCkurt],[CERNkurt],[CIkurt],[COOkurt],[CVSkurt],[DHRkurt],[DVAkurt],[XRAYkurt],[DXCMkurt],[EWkurt],[GILDkurt],[HCAkurt],[HSICkurt],[HOLXkurt],[HUMkurt],[IDXXkurt],[ILMNkurt],[INCYkurt],[ISRGkurt],[IQVkurt],[JNJkurt],[LHkurt],[LLYkurt],[MCKkurt],[MDTkurt],[MRKkurt],[MTDkurt],[MYLkurt],[PKIkurt],[PRGOkurt],[PFEkurt],[DGXkurt],[REGNkurt],[RMDkurt],[STEkurt],[SYKkurt],[TFXkurt],[TMOkurt],[UNHkurt],[UHSkurt],[VARkurt],[VRTXkurt],[WATkurt],[WSTkurt],[ZBHkurt],[ZTSkurt]],
'Skew': [[spskew],[haverageskew],[ABTskew],[ABBVskew],[ABMDskew],[Askew],[ALXNskew],[ALGNskew],[ABCskew],[AMGNskew],[ANTMskew],[BAXskew],[BDXskew],[BIIBskew],[BSXskew],[BMYskew],[CAHskew],[CNCskew],[CERNskew],[CIskew],[COOskew],[CVSskew],[DHRskew],[DVAskew],[XRAYskew],[DXCMskew],[EWskew],[GILDskew],[HCAskew],[HSICskew],[HOLXskew],[HUMskew],[IDXXskew],[ILMNskew],[INCYskew],[ISRGskew],[IQVskew],[JNJskew],[LHskew],[LLYskew],[MCKskew],[MDTskew],[MRKskew],[MTDskew],[MYLskew],[PKIskew],[PRGOskew],[PFEskew],[DGXskew],[REGNskew],[RMDskew],[STEskew],[SYKskew],[TFXskew],[TMOskew],[UNHskew],[UHSskew],[VARskew],[VRTXskew],[WATskew],[WSTskew],[ZBHskew],[ZTSskew]],
}
hdf = pd.DataFrame(Healthcare, columns = ['Mean', 'Variance', 'Kurtosis', 'Skew'], index= ['S&P 500','Average','ABT','ABBV','ABMD','A','ALXN','ALGN','ABC','AMGN','ANTM','BAX','BDX','BIIB','BSX','BMY','CAH','CNC','CERN','CI','COO','CVS','DHR','DVA','XRAY','DXCM','EW','GILD','HCA','HSIC','HOLX','HUM','IDXX','ILMN','INCY','ISRG','IQV','JNJ','LH','LLY','MCK','MDT','MRK','MTD','MYL','PKI','PRGO','PFE','DGX','REGN','RMD','STE','SYK','TFX','TMO','UNH','UHS','VAR','VRTX','WAT','WST','ZBH','ZTS']
)
pd.DataFrame(hdf)
hdf.sort_values("Mean", ascending=False)
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AFL = web.DataReader('AFL', 'yahoo', start, end)
AFL['returns'] = AFL['Close'].pct_change(1)
AFL['Cumulative Return'] = (1 + AFL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AFLmean = AFL['returns'].mean()
AFLvar = AFL['returns'].var()
AFLkurt = AFL['returns'].kurt()
AFLskew = AFL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AFLbef = web.DataReader('AFL', 'yahoo', start, crashstart)
AFLbef['avgreturnbefore'] = AFLbef['Close'].pct_change(1)
AFLbef['Cumulative Return Before Crash'] = (1 + AFLbef['avgreturnbefore']).cumprod()
#period of crash
AFLdur = web.DataReader('AFL', 'yahoo', crashstart, crashend)
AFLdur['avgreturnduring'] = AFLdur['Close'].pct_change(1)
AFLdur['Cumulative Return During Crash'] = (1 + AFLdur['avgreturnduring']).cumprod()
#period after crash
AFLaft = web.DataReader('AFL', 'yahoo', crashend, end)
AFLaft['avgreturnafter'] = AFLaft['Close'].pct_change(1)
AFLaft['Cumulative Return After Crash'] = (1 + AFLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ALL = web.DataReader('ALL', 'yahoo', start, end)
ALL['returns'] = ALL['Close'].pct_change(1)
ALL['Cumulative Return'] = (1 + ALL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ALLmean = ALL['returns'].mean()
ALLvar = ALL['returns'].var()
ALLkurt = ALL['returns'].kurt()
ALLskew = ALL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ALLbef = web.DataReader('ALL', 'yahoo', start, crashstart)
ALLbef['avgreturnbefore'] = ALLbef['Close'].pct_change(1)
ALLbef['Cumulative Return Before Crash'] = (1 + ALLbef['avgreturnbefore']).cumprod()
#period of crash
ALLdur = web.DataReader('ALL', 'yahoo', crashstart, crashend)
ALLdur['avgreturnduring'] = ALLdur['Close'].pct_change(1)
ALLdur['Cumulative Return During Crash'] = (1 + ALLdur['avgreturnduring']).cumprod()
#period after crash
ALLaft = web.DataReader('ALL', 'yahoo', crashend, end)
ALLaft['avgreturnafter'] = ALLaft['Close'].pct_change(1)
ALLaft['Cumulative Return After Crash'] = (1 + ALLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AXP = web.DataReader('AXP', 'yahoo', start, end)
AXP['returns'] = AXP['Close'].pct_change(1)
AXP['Cumulative Return'] = (1 + AXP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AXPmean = AXP['returns'].mean()
AXPvar = AXP['returns'].var()
AXPkurt = AXP['returns'].kurt()
AXPskew = AXP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AXPbef = web.DataReader('AXP', 'yahoo', start, crashstart)
AXPbef['avgreturnbefore'] = AXPbef['Close'].pct_change(1)
AXPbef['Cumulative Return Before Crash'] = (1 + AXPbef['avgreturnbefore']).cumprod()
#period of crash
AXPdur = web.DataReader('AXP', 'yahoo', crashstart, crashend)
AXPdur['avgreturnduring'] = AXPdur['Close'].pct_change(1)
AXPdur['Cumulative Return During Crash'] = (1 + AXPdur['avgreturnduring']).cumprod()
#period after crash
AXPaft = web.DataReader('AXP', 'yahoo', crashend, end)
AXPaft['avgreturnafter'] = AXPaft['Close'].pct_change(1)
AXPaft['Cumulative Return After Crash'] = (1 + AXPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AIG = web.DataReader('AIG', 'yahoo', start, end)
AIG['returns'] = AIG['Close'].pct_change(1)
AIG['Cumulative Return'] = (1 + AIG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AIGmean = AIG['returns'].mean()
AIGvar = AIG['returns'].var()
AIGkurt = AIG['returns'].kurt()
AIGskew = AIG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AIGbef = web.DataReader('AIG', 'yahoo', start, crashstart)
AIGbef['avgreturnbefore'] = AIGbef['Close'].pct_change(1)
AIGbef['Cumulative Return Before Crash'] = (1 + AIGbef['avgreturnbefore']).cumprod()
#period of crash
AIGdur = web.DataReader('AIG', 'yahoo', crashstart, crashend)
AIGdur['avgreturnduring'] = AIGdur['Close'].pct_change(1)
AIGdur['Cumulative Return During Crash'] = (1 + AIGdur['avgreturnduring']).cumprod()
#period after crash
AIGaft = web.DataReader('AIG', 'yahoo', crashend, end)
AIGaft['avgreturnafter'] = AIGaft['Close'].pct_change(1)
AIGaft['Cumulative Return After Crash'] = (1 + AIGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AMP = web.DataReader('AMP', 'yahoo', start, end)
AMP['returns'] = AMP['Close'].pct_change(1)
AMP['Cumulative Return'] = (1 + AMP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AMPmean = AMP['returns'].mean()
AMPvar = AMP['returns'].var()
AMPkurt = AMP['returns'].kurt()
AMPskew = AMP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AMPbef = web.DataReader('AMP', 'yahoo', start, crashstart)
AMPbef['avgreturnbefore'] = AMPbef['Close'].pct_change(1)
AMPbef['Cumulative Return Before Crash'] = (1 + AMPbef['avgreturnbefore']).cumprod()
#period of crash
AMPdur = web.DataReader('AMP', 'yahoo', crashstart, crashend)
AMPdur['avgreturnduring'] = AMPdur['Close'].pct_change(1)
AMPdur['Cumulative Return During Crash'] = (1 + AMPdur['avgreturnduring']).cumprod()
#period after crash
AMPaft = web.DataReader('AMP', 'yahoo', crashend, end)
AMPaft['avgreturnafter'] = AMPaft['Close'].pct_change(1)
AMPaft['Cumulative Return After Crash'] = (1 + AMPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AON = web.DataReader('AON', 'yahoo', start, end)
AON['returns'] = AON['Close'].pct_change(1)
AON['Cumulative Return'] = (1 + AON['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AONmean = AON['returns'].mean()
AONvar = AON['returns'].var()
AONkurt = AON['returns'].kurt()
AONskew = AON['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AONbef = web.DataReader('AON', 'yahoo', start, crashstart)
AONbef['avgreturnbefore'] = AONbef['Close'].pct_change(1)
AONbef['Cumulative Return Before Crash'] = (1 + AONbef['avgreturnbefore']).cumprod()
#period of crash
AONdur = web.DataReader('AON', 'yahoo', crashstart, crashend)
AONdur['avgreturnduring'] = AONdur['Close'].pct_change(1)
AONdur['Cumulative Return During Crash'] = (1 + AONdur['avgreturnduring']).cumprod()
#period after crash
AONaft = web.DataReader('AON', 'yahoo', crashend, end)
AONaft['avgreturnafter'] = AONaft['Close'].pct_change(1)
AONaft['Cumulative Return After Crash'] = (1 + AONaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AJG = web.DataReader('AJG', 'yahoo', start, end)
AJG['returns'] = AJG['Close'].pct_change(1)
AJG['Cumulative Return'] = (1 + AJG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AJGmean = AJG['returns'].mean()
AJGvar = AJG['returns'].var()
AJGkurt = AJG['returns'].kurt()
AJGskew = AJG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AJGbef = web.DataReader('AJG', 'yahoo', start, crashstart)
AJGbef['avgreturnbefore'] = AJGbef['Close'].pct_change(1)
AJGbef['Cumulative Return Before Crash'] = (1 + AJGbef['avgreturnbefore']).cumprod()
#period of crash
AJGdur = web.DataReader('AJG', 'yahoo', crashstart, crashend)
AJGdur['avgreturnduring'] = AJGdur['Close'].pct_change(1)
AJGdur['Cumulative Return During Crash'] = (1 + AJGdur['avgreturnduring']).cumprod()
#period after crash
AJGaft = web.DataReader('AJG', 'yahoo', crashend, end)
AJGaft['avgreturnafter'] = AJGaft['Close'].pct_change(1)
AJGaft['Cumulative Return After Crash'] = (1 + AJGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AIZ = web.DataReader('AIZ', 'yahoo', start, end)
AIZ['returns'] = AIZ['Close'].pct_change(1)
AIZ['Cumulative Return'] = (1 + AIZ['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AIZmean = AIZ['returns'].mean()
AIZvar = AIZ['returns'].var()
AIZkurt = AIZ['returns'].kurt()
AIZskew = AIZ['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AIZbef = web.DataReader('AIZ', 'yahoo', start, crashstart)
AIZbef['avgreturnbefore'] = AIZbef['Close'].pct_change(1)
AIZbef['Cumulative Return Before Crash'] = (1 + AIZbef['avgreturnbefore']).cumprod()
#period of crash
AIZdur = web.DataReader('AIZ', 'yahoo', crashstart, crashend)
AIZdur['avgreturnduring'] = AIZdur['Close'].pct_change(1)
AIZdur['Cumulative Return During Crash'] = (1 + AIZdur['avgreturnduring']).cumprod()
#period after crash
AIZaft = web.DataReader('AIZ', 'yahoo', crashend, end)
AIZaft['avgreturnafter'] = AIZaft['Close'].pct_change(1)
AIZaft['Cumulative Return After Crash'] = (1 + AIZaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BAC = web.DataReader('BAC', 'yahoo', start, end)
BAC['returns'] = BAC['Close'].pct_change(1)
BAC['Cumulative Return'] = (1 + BAC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BACmean = BAC['returns'].mean()
BACvar = BAC['returns'].var()
BACkurt = BAC['returns'].kurt()
BACskew = BAC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BACbef = web.DataReader('BAC', 'yahoo', start, crashstart)
BACbef['avgreturnbefore'] = BACbef['Close'].pct_change(1)
BACbef['Cumulative Return Before Crash'] = (1 + BACbef['avgreturnbefore']).cumprod()
#period of crash
BACdur = web.DataReader('BAC', 'yahoo', crashstart, crashend)
BACdur['avgreturnduring'] = BACdur['Close'].pct_change(1)
BACdur['Cumulative Return During Crash'] = (1 + BACdur['avgreturnduring']).cumprod()
#period after crash
BACaft = web.DataReader('BAC', 'yahoo', crashend, end)
BACaft['avgreturnafter'] = BACaft['Close'].pct_change(1)
BACaft['Cumulative Return After Crash'] = (1 + BACaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BK = web.DataReader('BK', 'yahoo', start, end)
BK['returns'] = BK['Close'].pct_change(1)
BK['Cumulative Return'] = (1 + BK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BKmean = BK['returns'].mean()
BKvar = BK['returns'].var()
BKkurt = BK['returns'].kurt()
BKskew = BK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BKbef = web.DataReader('BK', 'yahoo', start, crashstart)
BKbef['avgreturnbefore'] = BKbef['Close'].pct_change(1)
BKbef['Cumulative Return Before Crash'] = (1 + BKbef['avgreturnbefore']).cumprod()
#period of crash
BKdur = web.DataReader('BK', 'yahoo', crashstart, crashend)
BKdur['avgreturnduring'] = BKdur['Close'].pct_change(1)
BKdur['Cumulative Return During Crash'] = (1 + BKdur['avgreturnduring']).cumprod()
#period after crash
BKaft = web.DataReader('BK', 'yahoo', crashend, end)
BKaft['avgreturnafter'] = BKaft['Close'].pct_change(1)
BKaft['Cumulative Return After Crash'] = (1 + BKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BRKB = web.DataReader('BRK-B', 'yahoo', start, end)
BRKB['returns'] = BRKB['Close'].pct_change(1)
BRKB['Cumulative Return'] = (1 + BRKB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BRKBmean = BRKB['returns'].mean()
BRKBvar = BRKB['returns'].var()
BRKBkurt = BRKB['returns'].kurt()
BRKBskew = BRKB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BRKBbef = web.DataReader('BRK-B', 'yahoo', start, crashstart)
BRKBbef['avgreturnbefore'] = BRKBbef['Close'].pct_change(1)
BRKBbef['Cumulative Return Before Crash'] = (1 + BRKBbef['avgreturnbefore']).cumprod()
#period of crash
BRKBdur = web.DataReader('BRK-B', 'yahoo', crashstart, crashend)
BRKBdur['avgreturnduring'] = BRKBdur['Close'].pct_change(1)
BRKBdur['Cumulative Return During Crash'] = (1 + BRKBdur['avgreturnduring']).cumprod()
#period after crash
BRKBaft = web.DataReader('BRK-B', 'yahoo', crashend, end)
BRKBaft['avgreturnafter'] = BRKBaft['Close'].pct_change(1)
BRKBaft['Cumulative Return After Crash'] = (1 + BRKBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BLK = web.DataReader('BLK', 'yahoo', start, end)
BLK['returns'] = BLK['Close'].pct_change(1)
BLK['Cumulative Return'] = (1 + BLK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BLKmean = BLK['returns'].mean()
BLKvar = BLK['returns'].var()
BLKkurt = BLK['returns'].kurt()
BLKskew = BLK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BLKbef = web.DataReader('BLK', 'yahoo', start, crashstart)
BLKbef['avgreturnbefore'] = BLKbef['Close'].pct_change(1)
BLKbef['Cumulative Return Before Crash'] = (1 + BLKbef['avgreturnbefore']).cumprod()
#period of crash
BLKdur = web.DataReader('BLK', 'yahoo', crashstart, crashend)
BLKdur['avgreturnduring'] = BLKdur['Close'].pct_change(1)
BLKdur['Cumulative Return During Crash'] = (1 + BLKdur['avgreturnduring']).cumprod()
#period after crash
BLKaft = web.DataReader('BLK', 'yahoo', crashend, end)
BLKaft['avgreturnafter'] = BLKaft['Close'].pct_change(1)
BLKaft['Cumulative Return After Crash'] = (1 + BLKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
COF = web.DataReader('COF', 'yahoo', start, end)
COF['returns'] = COF['Close'].pct_change(1)
COF['Cumulative Return'] = (1 + COF['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
COFmean = COF['returns'].mean()
COFvar = COF['returns'].var()
COFkurt = COF['returns'].kurt()
COFskew = COF['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
COFbef = web.DataReader('COF', 'yahoo', start, crashstart)
COFbef['avgreturnbefore'] = COFbef['Close'].pct_change(1)
COFbef['Cumulative Return Before Crash'] = (1 + COFbef['avgreturnbefore']).cumprod()
#period of crash
COFdur = web.DataReader('COF', 'yahoo', crashstart, crashend)
COFdur['avgreturnduring'] = COFdur['Close'].pct_change(1)
COFdur['Cumulative Return During Crash'] = (1 + COFdur['avgreturnduring']).cumprod()
#period after crash
COFaft = web.DataReader('COF', 'yahoo', crashend, end)
COFaft['avgreturnafter'] = COFaft['Close'].pct_change(1)
COFaft['Cumulative Return After Crash'] = (1 + COFaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CBOE = web.DataReader('CBOE', 'yahoo', start, end)
CBOE['returns'] = CBOE['Close'].pct_change(1)
CBOE['Cumulative Return'] = (1 + CBOE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CBOEmean = CBOE['returns'].mean()
CBOEvar = CBOE['returns'].var()
CBOEkurt = CBOE['returns'].kurt()
CBOEskew = CBOE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CBOEbef = web.DataReader('CBOE', 'yahoo', start, crashstart)
CBOEbef['avgreturnbefore'] = CBOEbef['Close'].pct_change(1)
CBOEbef['Cumulative Return Before Crash'] = (1 + CBOEbef['avgreturnbefore']).cumprod()
#period of crash
CBOEdur = web.DataReader('CBOE', 'yahoo', crashstart, crashend)
CBOEdur['avgreturnduring'] = CBOEdur['Close'].pct_change(1)
CBOEdur['Cumulative Return During Crash'] = (1 + CBOEdur['avgreturnduring']).cumprod()
#period after crash
CBOEaft = web.DataReader('CBOE', 'yahoo', crashend, end)
CBOEaft['avgreturnafter'] = CBOEaft['Close'].pct_change(1)
CBOEaft['Cumulative Return After Crash'] = (1 + CBOEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SCHW = web.DataReader('SCHW', 'yahoo', start, end)
SCHW['returns'] = SCHW['Close'].pct_change(1)
SCHW['Cumulative Return'] = (1 + SCHW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SCHWmean = SCHW['returns'].mean()
SCHWvar = SCHW['returns'].var()
SCHWkurt = SCHW['returns'].kurt()
SCHWskew = SCHW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SCHWbef = web.DataReader('SCHW', 'yahoo', start, crashstart)
SCHWbef['avgreturnbefore'] = SCHWbef['Close'].pct_change(1)
SCHWbef['Cumulative Return Before Crash'] = (1 + SCHWbef['avgreturnbefore']).cumprod()
#period of crash
SCHWdur = web.DataReader('SCHW', 'yahoo', crashstart, crashend)
SCHWdur['avgreturnduring'] = SCHWdur['Close'].pct_change(1)
SCHWdur['Cumulative Return During Crash'] = (1 + SCHWdur['avgreturnduring']).cumprod()
#period after crash
SCHWaft = web.DataReader('SCHW', 'yahoo', crashend, end)
SCHWaft['avgreturnafter'] = SCHWaft['Close'].pct_change(1)
SCHWaft['Cumulative Return After Crash'] = (1 + SCHWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CB = web.DataReader('CB', 'yahoo', start, end)
CB['returns'] = CB['Close'].pct_change(1)
CB['Cumulative Return'] = (1 + CB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CBmean = CB['returns'].mean()
CBvar = CB['returns'].var()
CBkurt = CB['returns'].kurt()
CBskew = CB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CBbef = web.DataReader('CB', 'yahoo', start, crashstart)
CBbef['avgreturnbefore'] = CBbef['Close'].pct_change(1)
CBbef['Cumulative Return Before Crash'] = (1 + CBbef['avgreturnbefore']).cumprod()
#period of crash
CBdur = web.DataReader('CB', 'yahoo', crashstart, crashend)
CBdur['avgreturnduring'] = CBdur['Close'].pct_change(1)
CBdur['Cumulative Return During Crash'] = (1 + CBdur['avgreturnduring']).cumprod()
#period after crash
CBaft = web.DataReader('CB', 'yahoo', crashend, end)
CBaft['avgreturnafter'] = CBaft['Close'].pct_change(1)
CBaft['Cumulative Return After Crash'] = (1 + CBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CINF = web.DataReader('CINF', 'yahoo', start, end)
CINF['returns'] = CINF['Close'].pct_change(1)
CINF['Cumulative Return'] = (1 + CINF['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CINFmean = CINF['returns'].mean()
CINFvar = CINF['returns'].var()
CINFkurt = CINF['returns'].kurt()
CINFskew = CINF['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CINFbef = web.DataReader('CINF', 'yahoo', start, crashstart)
CINFbef['avgreturnbefore'] = CINFbef['Close'].pct_change(1)
CINFbef['Cumulative Return Before Crash'] = (1 + CINFbef['avgreturnbefore']).cumprod()
#period of crash
CINFdur = web.DataReader('CINF', 'yahoo', crashstart, crashend)
CINFdur['avgreturnduring'] = CINFdur['Close'].pct_change(1)
CINFdur['Cumulative Return During Crash'] = (1 + CINFdur['avgreturnduring']).cumprod()
#period after crash
CINFaft = web.DataReader('CINF', 'yahoo', crashend, end)
CINFaft['avgreturnafter'] = CINFaft['Close'].pct_change(1)
CINFaft['Cumulative Return After Crash'] = (1 + CINFaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
C = web.DataReader('C', 'yahoo', start, end)
C['returns'] = C['Close'].pct_change(1)
C['Cumulative Return'] = (1 + C['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
Cmean = C['returns'].mean()
Cvar = C['returns'].var()
Ckurt = C['returns'].kurt()
Cskew = C['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
Cbef = web.DataReader('C', 'yahoo', start, crashstart)
Cbef['avgreturnbefore'] = Cbef['Close'].pct_change(1)
Cbef['Cumulative Return Before Crash'] = (1 + Cbef['avgreturnbefore']).cumprod()
#period of crash
Cdur = web.DataReader('C', 'yahoo', crashstart, crashend)
Cdur['avgreturnduring'] = Cdur['Close'].pct_change(1)
Cdur['Cumulative Return During Crash'] = (1 + Cdur['avgreturnduring']).cumprod()
#period after crash
Caft = web.DataReader('C', 'yahoo', crashend, end)
Caft['avgreturnafter'] = Caft['Close'].pct_change(1)
Caft['Cumulative Return After Crash'] = (1 + Caft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CFG = web.DataReader('CFG', 'yahoo', start, end)
CFG['returns'] = CFG['Close'].pct_change(1)
CFG['Cumulative Return'] = (1 + CFG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CFGmean = CFG['returns'].mean()
CFGvar = CFG['returns'].var()
CFGkurt = CFG['returns'].kurt()
CFGskew = CFG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CFGbef = web.DataReader('CFG', 'yahoo', start, crashstart)
CFGbef['avgreturnbefore'] = CFGbef['Close'].pct_change(1)
CFGbef['Cumulative Return Before Crash'] = (1 + CFGbef['avgreturnbefore']).cumprod()
#period of crash
CFGdur = web.DataReader('CFG', 'yahoo', crashstart, crashend)
CFGdur['avgreturnduring'] = CFGdur['Close'].pct_change(1)
CFGdur['Cumulative Return During Crash'] = (1 + CFGdur['avgreturnduring']).cumprod()
#period after crash
CFGaft = web.DataReader('CFG', 'yahoo', crashend, end)
CFGaft['avgreturnafter'] = CFGaft['Close'].pct_change(1)
CFGaft['Cumulative Return After Crash'] = (1 + CFGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CME = web.DataReader('CME', 'yahoo', start, end)
CME['returns'] = CME['Close'].pct_change(1)
CME['Cumulative Return'] = (1 + CME['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CMEmean = CME['returns'].mean()
CMEvar = CME['returns'].var()
CMEkurt = CME['returns'].kurt()
CMEskew = CME['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CMEbef = web.DataReader('CME', 'yahoo', start, crashstart)
CMEbef['avgreturnbefore'] = CMEbef['Close'].pct_change(1)
CMEbef['Cumulative Return Before Crash'] = (1 + CMEbef['avgreturnbefore']).cumprod()
#period of crash
CMEdur = web.DataReader('CME', 'yahoo', crashstart, crashend)
CMEdur['avgreturnduring'] = CMEdur['Close'].pct_change(1)
CMEdur['Cumulative Return During Crash'] = (1 + CMEdur['avgreturnduring']).cumprod()
#period after crash
CMEaft = web.DataReader('CME', 'yahoo', crashend, end)
CMEaft['avgreturnafter'] = CMEaft['Close'].pct_change(1)
CMEaft['Cumulative Return After Crash'] = (1 + CMEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CMA = web.DataReader('CMA', 'yahoo', start, end)
CMA['returns'] = CMA['Close'].pct_change(1)
CMA['Cumulative Return'] = (1 + CMA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CMAmean = CMA['returns'].mean()
CMAvar = CMA['returns'].var()
CMAkurt = CMA['returns'].kurt()
CMAskew = CMA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CMAbef = web.DataReader('CMA', 'yahoo', start, crashstart)
CMAbef['avgreturnbefore'] = CMAbef['Close'].pct_change(1)
CMAbef['Cumulative Return Before Crash'] = (1 + CMAbef['avgreturnbefore']).cumprod()
#period of crash
CMAdur = web.DataReader('CMA', 'yahoo', crashstart, crashend)
CMAdur['avgreturnduring'] = CMAdur['Close'].pct_change(1)
CMAdur['Cumulative Return During Crash'] = (1 + CMAdur['avgreturnduring']).cumprod()
#period after crash
CMAaft = web.DataReader('CMA', 'yahoo', crashend, end)
CMAaft['avgreturnafter'] = CMAaft['Close'].pct_change(1)
CMAaft['Cumulative Return After Crash'] = (1 + CMAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DFS = web.DataReader('DFS', 'yahoo', start, end)
DFS['returns'] = DFS['Close'].pct_change(1)
DFS['Cumulative Return'] = (1 + DFS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DFSmean = DFS['returns'].mean()
DFSvar = DFS['returns'].var()
DFSkurt = DFS['returns'].kurt()
DFSskew = DFS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DFSbef = web.DataReader('DFS', 'yahoo', start, crashstart)
DFSbef['avgreturnbefore'] = DFSbef['Close'].pct_change(1)
DFSbef['Cumulative Return Before Crash'] = (1 + DFSbef['avgreturnbefore']).cumprod()
#period of crash
DFSdur = web.DataReader('DFS', 'yahoo', crashstart, crashend)
DFSdur['avgreturnduring'] = DFSdur['Close'].pct_change(1)
DFSdur['Cumulative Return During Crash'] = (1 + DFSdur['avgreturnduring']).cumprod()
#period after crash
DFSaft = web.DataReader('DFS', 'yahoo', crashend, end)
DFSaft['avgreturnafter'] = DFSaft['Close'].pct_change(1)
DFSaft['Cumulative Return After Crash'] = (1 + DFSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ETFC = web.DataReader('ETFC', 'yahoo', start, end)
ETFC['returns'] = ETFC['Close'].pct_change(1)
ETFC['Cumulative Return'] = (1 + ETFC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ETFCmean = ETFC['returns'].mean()
ETFCvar = ETFC['returns'].var()
ETFCkurt = ETFC['returns'].kurt()
ETFCskew = ETFC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ETFCbef = web.DataReader('ETFC', 'yahoo', start, crashstart)
ETFCbef['avgreturnbefore'] = ETFCbef['Close'].pct_change(1)
ETFCbef['Cumulative Return Before Crash'] = (1 + ETFCbef['avgreturnbefore']).cumprod()
#period of crash
ETFCdur = web.DataReader('ETFC', 'yahoo', crashstart, crashend)
ETFCdur['avgreturnduring'] = ETFCdur['Close'].pct_change(1)
ETFCdur['Cumulative Return During Crash'] = (1 + ETFCdur['avgreturnduring']).cumprod()
#period after crash
ETFCaft = web.DataReader('ETFC', 'yahoo', crashend, end)
ETFCaft['avgreturnafter'] = ETFCaft['Close'].pct_change(1)
ETFCaft['Cumulative Return After Crash'] = (1 + ETFCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
RE = web.DataReader('RE', 'yahoo', start, end)
RE['returns'] = RE['Close'].pct_change(1)
RE['Cumulative Return'] = (1 + RE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
REmean = RE['returns'].mean()
REvar = RE['returns'].var()
REkurt = RE['returns'].kurt()
REskew = RE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
REbef = web.DataReader('RE', 'yahoo', start, crashstart)
REbef['avgreturnbefore'] = REbef['Close'].pct_change(1)
REbef['Cumulative Return Before Crash'] = (1 + REbef['avgreturnbefore']).cumprod()
#period of crash
REdur = web.DataReader('RE', 'yahoo', crashstart, crashend)
REdur['avgreturnduring'] = REdur['Close'].pct_change(1)
REdur['Cumulative Return During Crash'] = (1 + REdur['avgreturnduring']).cumprod()
#period after crash
REaft = web.DataReader('RE', 'yahoo', crashend, end)
REaft['avgreturnafter'] = REaft['Close'].pct_change(1)
REaft['Cumulative Return After Crash'] = (1 + REaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FITB = web.DataReader('FITB', 'yahoo', start, end)
FITB['returns'] = FITB['Close'].pct_change(1)
FITB['Cumulative Return'] = (1 + FITB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FITBmean = FITB['returns'].mean()
FITBvar = FITB['returns'].var()
FITBkurt = FITB['returns'].kurt()
FITBskew = FITB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FITBbef = web.DataReader('FITB', 'yahoo', start, crashstart)
FITBbef['avgreturnbefore'] = FITBbef['Close'].pct_change(1)
FITBbef['Cumulative Return Before Crash'] = (1 + FITBbef['avgreturnbefore']).cumprod()
#period of crash
FITBdur = web.DataReader('FITB', 'yahoo', crashstart, crashend)
FITBdur['avgreturnduring'] = FITBdur['Close'].pct_change(1)
FITBdur['Cumulative Return During Crash'] = (1 + FITBdur['avgreturnduring']).cumprod()
#period after crash
FITBaft = web.DataReader('FITB', 'yahoo', crashend, end)
FITBaft['avgreturnafter'] = FITBaft['Close'].pct_change(1)
FITBaft['Cumulative Return After Crash'] = (1 + FITBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FRC = web.DataReader('FRC', 'yahoo', start, end)
FRC['returns'] = FRC['Close'].pct_change(1)
FRC['Cumulative Return'] = (1 + FRC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FRCmean = FRC['returns'].mean()
FRCvar = FRC['returns'].var()
FRCkurt = FRC['returns'].kurt()
FRCskew = FRC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FRCbef = web.DataReader('FRC', 'yahoo', start, crashstart)
FRCbef['avgreturnbefore'] = FRCbef['Close'].pct_change(1)
FRCbef['Cumulative Return Before Crash'] = (1 + FRCbef['avgreturnbefore']).cumprod()
#period of crash
FRCdur = web.DataReader('FRC', 'yahoo', crashstart, crashend)
FRCdur['avgreturnduring'] = FRCdur['Close'].pct_change(1)
FRCdur['Cumulative Return During Crash'] = (1 + FRCdur['avgreturnduring']).cumprod()
#period after crash
FRCaft = web.DataReader('FRC', 'yahoo', crashend, end)
FRCaft['avgreturnafter'] = FRCaft['Close'].pct_change(1)
FRCaft['Cumulative Return After Crash'] = (1 + FRCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BEN = web.DataReader('BEN', 'yahoo', start, end)
BEN['returns'] = BEN['Close'].pct_change(1)
BEN['Cumulative Return'] = (1 + BEN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BENmean = BEN['returns'].mean()
BENvar = BEN['returns'].var()
BENkurt = BEN['returns'].kurt()
BENskew = BEN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BENbef = web.DataReader('BEN', 'yahoo', start, crashstart)
BENbef['avgreturnbefore'] = BENbef['Close'].pct_change(1)
BENbef['Cumulative Return Before Crash'] = (1 + BENbef['avgreturnbefore']).cumprod()
#period of crash
BENdur = web.DataReader('BEN', 'yahoo', crashstart, crashend)
BENdur['avgreturnduring'] = BENdur['Close'].pct_change(1)
BENdur['Cumulative Return During Crash'] = (1 + BENdur['avgreturnduring']).cumprod()
#period after crash
BENaft = web.DataReader('BEN', 'yahoo', crashend, end)
BENaft['avgreturnafter'] = BENaft['Close'].pct_change(1)
BENaft['Cumulative Return After Crash'] = (1 + BENaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GL = web.DataReader('GL', 'yahoo', start, end)
GL['returns'] = GL['Close'].pct_change(1)
GL['Cumulative Return'] = (1 + GL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GLmean = GL['returns'].mean()
GLvar = GL['returns'].var()
GLkurt = GL['returns'].kurt()
GLskew = GL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GLbef = web.DataReader('GL', 'yahoo', start, crashstart)
GLbef['avgreturnbefore'] = GLbef['Close'].pct_change(1)
GLbef['Cumulative Return Before Crash'] = (1 + GLbef['avgreturnbefore']).cumprod()
#period of crash
GLdur = web.DataReader('GL', 'yahoo', crashstart, crashend)
GLdur['avgreturnduring'] = GLdur['Close'].pct_change(1)
GLdur['Cumulative Return During Crash'] = (1 + GLdur['avgreturnduring']).cumprod()
#period after crash
GLaft = web.DataReader('GL', 'yahoo', crashend, end)
GLaft['avgreturnafter'] = GLaft['Close'].pct_change(1)
GLaft['Cumulative Return After Crash'] = (1 + GLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GS = web.DataReader('GS', 'yahoo', start, end)
GS['returns'] = GS['Close'].pct_change(1)
GS['Cumulative Return'] = (1 + GS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GSmean = GS['returns'].mean()
GSvar = GS['returns'].var()
GSkurt = GS['returns'].kurt()
GSskew = GS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GSbef = web.DataReader('GS', 'yahoo', start, crashstart)
GSbef['avgreturnbefore'] = GSbef['Close'].pct_change(1)
GSbef['Cumulative Return Before Crash'] = (1 + GSbef['avgreturnbefore']).cumprod()
#period of crash
GSdur = web.DataReader('GS', 'yahoo', crashstart, crashend)
GSdur['avgreturnduring'] = GSdur['Close'].pct_change(1)
GSdur['Cumulative Return During Crash'] = (1 + GSdur['avgreturnduring']).cumprod()
#period after crash
GSaft = web.DataReader('GS', 'yahoo', crashend, end)
GSaft['avgreturnafter'] = GSaft['Close'].pct_change(1)
GSaft['Cumulative Return After Crash'] = (1 + GSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HIG = web.DataReader('HIG', 'yahoo', start, end)
HIG['returns'] = HIG['Close'].pct_change(1)
HIG['Cumulative Return'] = (1 + HIG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HIGmean = HIG['returns'].mean()
HIGvar = HIG['returns'].var()
HIGkurt = HIG['returns'].kurt()
HIGskew = HIG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HIGbef = web.DataReader('HIG', 'yahoo', start, crashstart)
HIGbef['avgreturnbefore'] = HIGbef['Close'].pct_change(1)
HIGbef['Cumulative Return Before Crash'] = (1 + HIGbef['avgreturnbefore']).cumprod()
#period of crash
HIGdur = web.DataReader('HIG', 'yahoo', crashstart, crashend)
HIGdur['avgreturnduring'] = HIGdur['Close'].pct_change(1)
HIGdur['Cumulative Return During Crash'] = (1 + HIGdur['avgreturnduring']).cumprod()
#period after crash
HIGaft = web.DataReader('HIG', 'yahoo', crashend, end)
HIGaft['avgreturnafter'] = HIGaft['Close'].pct_change(1)
HIGaft['Cumulative Return After Crash'] = (1 + HIGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HBAN = web.DataReader('HBAN', 'yahoo', start, end)
HBAN['returns'] = HBAN['Close'].pct_change(1)
HBAN['Cumulative Return'] = (1 + HBAN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HBANmean = HBAN['returns'].mean()
HBANvar = HBAN['returns'].var()
HBANkurt = HBAN['returns'].kurt()
HBANskew = HBAN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HBANbef = web.DataReader('HBAN', 'yahoo', start, crashstart)
HBANbef['avgreturnbefore'] = HBANbef['Close'].pct_change(1)
HBANbef['Cumulative Return Before Crash'] = (1 + HBANbef['avgreturnbefore']).cumprod()
#period of crash
HBANdur = web.DataReader('HBAN', 'yahoo', crashstart, crashend)
HBANdur['avgreturnduring'] = HBANdur['Close'].pct_change(1)
HBANdur['Cumulative Return During Crash'] = (1 + HBANdur['avgreturnduring']).cumprod()
#period after crash
HBANaft = web.DataReader('HBAN', 'yahoo', crashend, end)
HBANaft['avgreturnafter'] = HBANaft['Close'].pct_change(1)
HBANaft['Cumulative Return After Crash'] = (1 + HBANaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ICE = web.DataReader('ICE', 'yahoo', start, end)
ICE['returns'] = ICE['Close'].pct_change(1)
ICE['Cumulative Return'] = (1 + ICE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ICEmean = ICE['returns'].mean()
ICEvar = ICE['returns'].var()
ICEkurt = ICE['returns'].kurt()
ICEskew = ICE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ICEbef = web.DataReader('ICE', 'yahoo', start, crashstart)
ICEbef['avgreturnbefore'] = ICEbef['Close'].pct_change(1)
ICEbef['Cumulative Return Before Crash'] = (1 + ICEbef['avgreturnbefore']).cumprod()
#period of crash
ICEdur = web.DataReader('ICE', 'yahoo', crashstart, crashend)
ICEdur['avgreturnduring'] = ICEdur['Close'].pct_change(1)
ICEdur['Cumulative Return During Crash'] = (1 + ICEdur['avgreturnduring']).cumprod()
#period after crash
ICEaft = web.DataReader('ICE', 'yahoo', crashend, end)
ICEaft['avgreturnafter'] = ICEaft['Close'].pct_change(1)
ICEaft['Cumulative Return After Crash'] = (1 + ICEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
IVZ = web.DataReader('IVZ', 'yahoo', start, end)
IVZ['returns'] = IVZ['Close'].pct_change(1)
IVZ['Cumulative Return'] = (1 + IVZ['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
IVZmean = IVZ['returns'].mean()
IVZvar = IVZ['returns'].var()
IVZkurt = IVZ['returns'].kurt()
IVZskew = IVZ['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
IVZbef = web.DataReader('IVZ', 'yahoo', start, crashstart)
IVZbef['avgreturnbefore'] = IVZbef['Close'].pct_change(1)
IVZbef['Cumulative Return Before Crash'] = (1 + IVZbef['avgreturnbefore']).cumprod()
#period of crash
IVZdur = web.DataReader('IVZ', 'yahoo', crashstart, crashend)
IVZdur['avgreturnduring'] = IVZdur['Close'].pct_change(1)
IVZdur['Cumulative Return During Crash'] = (1 + IVZdur['avgreturnduring']).cumprod()
#period after crash
IVZaft = web.DataReader('IVZ', 'yahoo', crashend, end)
IVZaft['avgreturnafter'] = IVZaft['Close'].pct_change(1)
IVZaft['Cumulative Return After Crash'] = (1 + IVZaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
JPM = web.DataReader('JPM', 'yahoo', start, end)
JPM['returns'] = JPM['Close'].pct_change(1)
JPM['Cumulative Return'] = (1 + JPM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
JPMmean = JPM['returns'].mean()
JPMvar = JPM['returns'].var()
JPMkurt = JPM['returns'].kurt()
JPMskew = JPM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
JPMbef = web.DataReader('JPM', 'yahoo', start, crashstart)
JPMbef['avgreturnbefore'] = JPMbef['Close'].pct_change(1)
JPMbef['Cumulative Return Before Crash'] = (1 + JPMbef['avgreturnbefore']).cumprod()
#period of crash
JPMdur = web.DataReader('JPM', 'yahoo', crashstart, crashend)
JPMdur['avgreturnduring'] = JPMdur['Close'].pct_change(1)
JPMdur['Cumulative Return During Crash'] = (1 + JPMdur['avgreturnduring']).cumprod()
#period after crash
JPMaft = web.DataReader('JPM', 'yahoo', crashend, end)
JPMaft['avgreturnafter'] = JPMaft['Close'].pct_change(1)
JPMaft['Cumulative Return After Crash'] = (1 + JPMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
KEY = web.DataReader('KEY', 'yahoo', start, end)
KEY['returns'] = KEY['Close'].pct_change(1)
KEY['Cumulative Return'] = (1 + KEY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
KEYmean = KEY['returns'].mean()
KEYvar = KEY['returns'].var()
KEYkurt = KEY['returns'].kurt()
KEYskew = KEY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
KEYbef = web.DataReader('KEY', 'yahoo', start, crashstart)
KEYbef['avgreturnbefore'] = KEYbef['Close'].pct_change(1)
KEYbef['Cumulative Return Before Crash'] = (1 + KEYbef['avgreturnbefore']).cumprod()
#period of crash
KEYdur = web.DataReader('KEY', 'yahoo', crashstart, crashend)
KEYdur['avgreturnduring'] = KEYdur['Close'].pct_change(1)
KEYdur['Cumulative Return During Crash'] = (1 + KEYdur['avgreturnduring']).cumprod()
#period after crash
KEYaft = web.DataReader('KEY', 'yahoo', crashend, end)
KEYaft['avgreturnafter'] = KEYaft['Close'].pct_change(1)
KEYaft['Cumulative Return After Crash'] = (1 + KEYaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LNC = web.DataReader('LNC', 'yahoo', start, end)
LNC['returns'] = LNC['Close'].pct_change(1)
LNC['Cumulative Return'] = (1 + LNC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LNCmean = LNC['returns'].mean()
LNCvar = LNC['returns'].var()
LNCkurt = LNC['returns'].kurt()
LNCskew = LNC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LNCbef = web.DataReader('LNC', 'yahoo', start, crashstart)
LNCbef['avgreturnbefore'] = LNCbef['Close'].pct_change(1)
LNCbef['Cumulative Return Before Crash'] = (1 + LNCbef['avgreturnbefore']).cumprod()
#period of crash
LNCdur = web.DataReader('LNC', 'yahoo', crashstart, crashend)
LNCdur['avgreturnduring'] = LNCdur['Close'].pct_change(1)
LNCdur['Cumulative Return During Crash'] = (1 + LNCdur['avgreturnduring']).cumprod()
#period after crash
LNCaft = web.DataReader('LNC', 'yahoo', crashend, end)
LNCaft['avgreturnafter'] = LNCaft['Close'].pct_change(1)
LNCaft['Cumulative Return After Crash'] = (1 + LNCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
L = web.DataReader('L', 'yahoo', start, end)
L['returns'] = L['Close'].pct_change(1)
L['Cumulative Return'] = (1 + L['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
Lmean = L['returns'].mean()
Lvar = L['returns'].var()
Lkurt = L['returns'].kurt()
Lskew = L['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
Lbef = web.DataReader('L', 'yahoo', start, crashstart)
Lbef['avgreturnbefore'] = Lbef['Close'].pct_change(1)
Lbef['Cumulative Return Before Crash'] = (1 + Lbef['avgreturnbefore']).cumprod()
#period of crash
Ldur = web.DataReader('L', 'yahoo', crashstart, crashend)
Ldur['avgreturnduring'] = Ldur['Close'].pct_change(1)
Ldur['Cumulative Return During Crash'] = (1 + Ldur['avgreturnduring']).cumprod()
#period after crash
Laft = web.DataReader('L', 'yahoo', crashend, end)
Laft['avgreturnafter'] = Laft['Close'].pct_change(1)
Laft['Cumulative Return After Crash'] = (1 + Laft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MTB = web.DataReader('MTB', 'yahoo', start, end)
MTB['returns'] = MTB['Close'].pct_change(1)
MTB['Cumulative Return'] = (1 + MTB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MTBmean = MTB['returns'].mean()
MTBvar = MTB['returns'].var()
MTBkurt = MTB['returns'].kurt()
MTBskew = MTB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MTBbef = web.DataReader('MTB', 'yahoo', start, crashstart)
MTBbef['avgreturnbefore'] = MTBbef['Close'].pct_change(1)
MTBbef['Cumulative Return Before Crash'] = (1 + MTBbef['avgreturnbefore']).cumprod()
#period of crash
MTBdur = web.DataReader('MTB', 'yahoo', crashstart, crashend)
MTBdur['avgreturnduring'] = MTBdur['Close'].pct_change(1)
MTBdur['Cumulative Return During Crash'] = (1 + MTBdur['avgreturnduring']).cumprod()
#period after crash
MTBaft = web.DataReader('MTB', 'yahoo', crashend, end)
MTBaft['avgreturnafter'] = MTBaft['Close'].pct_change(1)
MTBaft['Cumulative Return After Crash'] = (1 + MTBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MKTX = web.DataReader('MKTX', 'yahoo', start, end)
MKTX['returns'] = MKTX['Close'].pct_change(1)
MKTX['Cumulative Return'] = (1 + MKTX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MKTXmean = MKTX['returns'].mean()
MKTXvar = MKTX['returns'].var()
MKTXkurt = MKTX['returns'].kurt()
MKTXskew = MKTX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MKTXbef = web.DataReader('MKTX', 'yahoo', start, crashstart)
MKTXbef['avgreturnbefore'] = MKTXbef['Close'].pct_change(1)
MKTXbef['Cumulative Return Before Crash'] = (1 + MKTXbef['avgreturnbefore']).cumprod()
#period of crash
MKTXdur = web.DataReader('MKTX', 'yahoo', crashstart, crashend)
MKTXdur['avgreturnduring'] = MKTXdur['Close'].pct_change(1)
MKTXdur['Cumulative Return During Crash'] = (1 + MKTXdur['avgreturnduring']).cumprod()
#period after crash
MKTXaft = web.DataReader('MKTX', 'yahoo', crashend, end)
MKTXaft['avgreturnafter'] = MKTXaft['Close'].pct_change(1)
MKTXaft['Cumulative Return After Crash'] = (1 + MKTXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MMC = web.DataReader('MMC', 'yahoo', start, end)
MMC['returns'] = MMC['Close'].pct_change(1)
MMC['Cumulative Return'] = (1 + MMC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MMCmean = MMC['returns'].mean()
MMCvar = MMC['returns'].var()
MMCkurt = MMC['returns'].kurt()
MMCskew = MMC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MMCbef = web.DataReader('MMC', 'yahoo', start, crashstart)
MMCbef['avgreturnbefore'] = MMCbef['Close'].pct_change(1)
MMCbef['Cumulative Return Before Crash'] = (1 + MMCbef['avgreturnbefore']).cumprod()
#period of crash
MMCdur = web.DataReader('MMC', 'yahoo', crashstart, crashend)
MMCdur['avgreturnduring'] = MMCdur['Close'].pct_change(1)
MMCdur['Cumulative Return During Crash'] = (1 + MMCdur['avgreturnduring']).cumprod()
#period after crash
MMCaft = web.DataReader('MMC', 'yahoo', crashend, end)
MMCaft['avgreturnafter'] = MMCaft['Close'].pct_change(1)
MMCaft['Cumulative Return After Crash'] = (1 + MMCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MET = web.DataReader('MET', 'yahoo', start, end)
MET['returns'] = MET['Close'].pct_change(1)
MET['Cumulative Return'] = (1 + MET['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
METmean = MET['returns'].mean()
METvar = MET['returns'].var()
METkurt = MET['returns'].kurt()
METskew = MET['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
METbef = web.DataReader('MET', 'yahoo', start, crashstart)
METbef['avgreturnbefore'] = METbef['Close'].pct_change(1)
METbef['Cumulative Return Before Crash'] = (1 + METbef['avgreturnbefore']).cumprod()
#period of crash
METdur = web.DataReader('MET', 'yahoo', crashstart, crashend)
METdur['avgreturnduring'] = METdur['Close'].pct_change(1)
METdur['Cumulative Return During Crash'] = (1 + METdur['avgreturnduring']).cumprod()
#period after crash
METaft = web.DataReader('MET', 'yahoo', crashend, end)
METaft['avgreturnafter'] = METaft['Close'].pct_change(1)
METaft['Cumulative Return After Crash'] = (1 + METaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MCO = web.DataReader('MCO', 'yahoo', start, end)
MCO['returns'] = MCO['Close'].pct_change(1)
MCO['Cumulative Return'] = (1 + MCO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MCOmean = MCO['returns'].mean()
MCOvar = MCO['returns'].var()
MCOkurt = MCO['returns'].kurt()
MCOskew = MCO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MCObef = web.DataReader('MCO', 'yahoo', start, crashstart)
MCObef['avgreturnbefore'] = MCObef['Close'].pct_change(1)
MCObef['Cumulative Return Before Crash'] = (1 + MCObef['avgreturnbefore']).cumprod()
#period of crash
MCOdur = web.DataReader('MCO', 'yahoo', crashstart, crashend)
MCOdur['avgreturnduring'] = MCOdur['Close'].pct_change(1)
MCOdur['Cumulative Return During Crash'] = (1 + MCOdur['avgreturnduring']).cumprod()
#period after crash
MCOaft = web.DataReader('MCO', 'yahoo', crashend, end)
MCOaft['avgreturnafter'] = MCOaft['Close'].pct_change(1)
MCOaft['Cumulative Return After Crash'] = (1 + MCOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MS = web.DataReader('MS', 'yahoo', start, end)
MS['returns'] = MS['Close'].pct_change(1)
MS['Cumulative Return'] = (1 + MS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MSmean = MS['returns'].mean()
MSvar = MS['returns'].var()
MSkurt = MS['returns'].kurt()
MSskew = MS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MSbef = web.DataReader('MS', 'yahoo', start, crashstart)
MSbef['avgreturnbefore'] = MSbef['Close'].pct_change(1)
MSbef['Cumulative Return Before Crash'] = (1 + MSbef['avgreturnbefore']).cumprod()
#period of crash
MSdur = web.DataReader('MS', 'yahoo', crashstart, crashend)
MSdur['avgreturnduring'] = MSdur['Close'].pct_change(1)
MSdur['Cumulative Return During Crash'] = (1 + MSdur['avgreturnduring']).cumprod()
#period after crash
MSaft = web.DataReader('MS', 'yahoo', crashend, end)
MSaft['avgreturnafter'] = MSaft['Close'].pct_change(1)
MSaft['Cumulative Return After Crash'] = (1 + MSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MSCI = web.DataReader('MSCI', 'yahoo', start, end)
MSCI['returns'] = MSCI['Close'].pct_change(1)
MSCI['Cumulative Return'] = (1 + MSCI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MSCImean = MSCI['returns'].mean()
MSCIvar = MSCI['returns'].var()
MSCIkurt = MSCI['returns'].kurt()
MSCIskew = MSCI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MSCIbef = web.DataReader('MSCI', 'yahoo', start, crashstart)
MSCIbef['avgreturnbefore'] = MSCIbef['Close'].pct_change(1)
MSCIbef['Cumulative Return Before Crash'] = (1 + MSCIbef['avgreturnbefore']).cumprod()
#period of crash
MSCIdur = web.DataReader('MSCI', 'yahoo', crashstart, crashend)
MSCIdur['avgreturnduring'] = MSCIdur['Close'].pct_change(1)
MSCIdur['Cumulative Return During Crash'] = (1 + MSCIdur['avgreturnduring']).cumprod()
#period after crash
MSCIaft = web.DataReader('MSCI', 'yahoo', crashend, end)
MSCIaft['avgreturnafter'] = MSCIaft['Close'].pct_change(1)
MSCIaft['Cumulative Return After Crash'] = (1 + MSCIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NDAQ = web.DataReader('NDAQ', 'yahoo', start, end)
NDAQ['returns'] = NDAQ['Close'].pct_change(1)
NDAQ['Cumulative Return'] = (1 + NDAQ['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NDAQmean = NDAQ['returns'].mean()
NDAQvar = NDAQ['returns'].var()
NDAQkurt = NDAQ['returns'].kurt()
NDAQskew = NDAQ['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NDAQbef = web.DataReader('NDAQ', 'yahoo', start, crashstart)
NDAQbef['avgreturnbefore'] = NDAQbef['Close'].pct_change(1)
NDAQbef['Cumulative Return Before Crash'] = (1 + NDAQbef['avgreturnbefore']).cumprod()
#period of crash
NDAQdur = web.DataReader('NDAQ', 'yahoo', crashstart, crashend)
NDAQdur['avgreturnduring'] = NDAQdur['Close'].pct_change(1)
NDAQdur['Cumulative Return During Crash'] = (1 + NDAQdur['avgreturnduring']).cumprod()
#period after crash
NDAQaft = web.DataReader('NDAQ', 'yahoo', crashend, end)
NDAQaft['avgreturnafter'] = NDAQaft['Close'].pct_change(1)
NDAQaft['Cumulative Return After Crash'] = (1 + NDAQaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NTRS = web.DataReader('NTRS', 'yahoo', start, end)
NTRS['returns'] = NTRS['Close'].pct_change(1)
NTRS['Cumulative Return'] = (1 + NTRS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NTRSmean = NTRS['returns'].mean()
NTRSvar = NTRS['returns'].var()
NTRSkurt = NTRS['returns'].kurt()
NTRSskew = NTRS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NTRSbef = web.DataReader('NTRS', 'yahoo', start, crashstart)
NTRSbef['avgreturnbefore'] = NTRSbef['Close'].pct_change(1)
NTRSbef['Cumulative Return Before Crash'] = (1 + NTRSbef['avgreturnbefore']).cumprod()
#period of crash
NTRSdur = web.DataReader('NTRS', 'yahoo', crashstart, crashend)
NTRSdur['avgreturnduring'] = NTRSdur['Close'].pct_change(1)
NTRSdur['Cumulative Return During Crash'] = (1 + NTRSdur['avgreturnduring']).cumprod()
#period after crash
NTRSaft = web.DataReader('NTRS', 'yahoo', crashend, end)
NTRSaft['avgreturnafter'] = NTRSaft['Close'].pct_change(1)
NTRSaft['Cumulative Return After Crash'] = (1 + NTRSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PBCT = web.DataReader('PBCT', 'yahoo', start, end)
PBCT['returns'] = PBCT['Close'].pct_change(1)
PBCT['Cumulative Return'] = (1 + PBCT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PBCTmean = PBCT['returns'].mean()
PBCTvar = PBCT['returns'].var()
PBCTkurt = PBCT['returns'].kurt()
PBCTskew = PBCT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PBCTbef = web.DataReader('PBCT', 'yahoo', start, crashstart)
PBCTbef['avgreturnbefore'] = PBCTbef['Close'].pct_change(1)
PBCTbef['Cumulative Return Before Crash'] = (1 + PBCTbef['avgreturnbefore']).cumprod()
#period of crash
PBCTdur = web.DataReader('PBCT', 'yahoo', crashstart, crashend)
PBCTdur['avgreturnduring'] = PBCTdur['Close'].pct_change(1)
PBCTdur['Cumulative Return During Crash'] = (1 + PBCTdur['avgreturnduring']).cumprod()
#period after crash
PBCTaft = web.DataReader('PBCT', 'yahoo', crashend, end)
PBCTaft['avgreturnafter'] = PBCTaft['Close'].pct_change(1)
PBCTaft['Cumulative Return After Crash'] = (1 + PBCTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PNC = web.DataReader('PNC', 'yahoo', start, end)
PNC['returns'] = PNC['Close'].pct_change(1)
PNC['Cumulative Return'] = (1 + PNC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PNCmean = PNC['returns'].mean()
PNCvar = PNC['returns'].var()
PNCkurt = PNC['returns'].kurt()
PNCskew = PNC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PNCbef = web.DataReader('PNC', 'yahoo', start, crashstart)
PNCbef['avgreturnbefore'] = PNCbef['Close'].pct_change(1)
PNCbef['Cumulative Return Before Crash'] = (1 + PNCbef['avgreturnbefore']).cumprod()
#period of crash
PNCdur = web.DataReader('PNC', 'yahoo', crashstart, crashend)
PNCdur['avgreturnduring'] = PNCdur['Close'].pct_change(1)
PNCdur['Cumulative Return During Crash'] = (1 + PNCdur['avgreturnduring']).cumprod()
#period after crash
PNCaft = web.DataReader('PNC', 'yahoo', crashend, end)
PNCaft['avgreturnafter'] = PNCaft['Close'].pct_change(1)
PNCaft['Cumulative Return After Crash'] = (1 + PNCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PFG = web.DataReader('PFG', 'yahoo', start, end)
PFG['returns'] = PFG['Close'].pct_change(1)
PFG['Cumulative Return'] = (1 + PFG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PFGmean = PFG['returns'].mean()
PFGvar = PFG['returns'].var()
PFGkurt = PFG['returns'].kurt()
PFGskew = PFG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PFGbef = web.DataReader('PFG', 'yahoo', start, crashstart)
PFGbef['avgreturnbefore'] = PFGbef['Close'].pct_change(1)
PFGbef['Cumulative Return Before Crash'] = (1 + PFGbef['avgreturnbefore']).cumprod()
#period of crash
PFGdur = web.DataReader('PFG', 'yahoo', crashstart, crashend)
PFGdur['avgreturnduring'] = PFGdur['Close'].pct_change(1)
PFGdur['Cumulative Return During Crash'] = (1 + PFGdur['avgreturnduring']).cumprod()
#period after crash
PFGaft = web.DataReader('PFG', 'yahoo', crashend, end)
PFGaft['avgreturnafter'] = PFGaft['Close'].pct_change(1)
PFGaft['Cumulative Return After Crash'] = (1 + PFGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PGR = web.DataReader('PGR', 'yahoo', start, end)
PGR['returns'] = PGR['Close'].pct_change(1)
PGR['Cumulative Return'] = (1 + PGR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PGRmean = PGR['returns'].mean()
PGRvar = PGR['returns'].var()
PGRkurt = PGR['returns'].kurt()
PGRskew = PGR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PGRbef = web.DataReader('PGR', 'yahoo', start, crashstart)
PGRbef['avgreturnbefore'] = PGRbef['Close'].pct_change(1)
PGRbef['Cumulative Return Before Crash'] = (1 + PGRbef['avgreturnbefore']).cumprod()
#period of crash
PGRdur = web.DataReader('PGR', 'yahoo', crashstart, crashend)
PGRdur['avgreturnduring'] = PGRdur['Close'].pct_change(1)
PGRdur['Cumulative Return During Crash'] = (1 + PGRdur['avgreturnduring']).cumprod()
#period after crash
PGRaft = web.DataReader('PGR', 'yahoo', crashend, end)
PGRaft['avgreturnafter'] = PGRaft['Close'].pct_change(1)
PGRaft['Cumulative Return After Crash'] = (1 + PGRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PRU = web.DataReader('PRU', 'yahoo', start, end)
PRU['returns'] = PRU['Close'].pct_change(1)
PRU['Cumulative Return'] = (1 + PRU['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PRUmean = PRU['returns'].mean()
PRUvar = PRU['returns'].var()
PRUkurt = PRU['returns'].kurt()
PRUskew = PRU['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PRUbef = web.DataReader('PRU', 'yahoo', start, crashstart)
PRUbef['avgreturnbefore'] = PRUbef['Close'].pct_change(1)
PRUbef['Cumulative Return Before Crash'] = (1 + PRUbef['avgreturnbefore']).cumprod()
#period of crash
PRUdur = web.DataReader('PRU', 'yahoo', crashstart, crashend)
PRUdur['avgreturnduring'] = PRUdur['Close'].pct_change(1)
PRUdur['Cumulative Return During Crash'] = (1 + PRUdur['avgreturnduring']).cumprod()
#period after crash
PRUaft = web.DataReader('PRU', 'yahoo', crashend, end)
PRUaft['avgreturnafter'] = PRUaft['Close'].pct_change(1)
PRUaft['Cumulative Return After Crash'] = (1 + PRUaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
RJF = web.DataReader('RJF', 'yahoo', start, end)
RJF['returns'] = RJF['Close'].pct_change(1)
RJF['Cumulative Return'] = (1 + RJF['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
RJFmean = RJF['returns'].mean()
RJFvar = RJF['returns'].var()
RJFkurt = RJF['returns'].kurt()
RJFskew = RJF['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
RJFbef = web.DataReader('RJF', 'yahoo', start, crashstart)
RJFbef['avgreturnbefore'] = RJFbef['Close'].pct_change(1)
RJFbef['Cumulative Return Before Crash'] = (1 + RJFbef['avgreturnbefore']).cumprod()
#period of crash
RJFdur = web.DataReader('RJF', 'yahoo', crashstart, crashend)
RJFdur['avgreturnduring'] = RJFdur['Close'].pct_change(1)
RJFdur['Cumulative Return During Crash'] = (1 + RJFdur['avgreturnduring']).cumprod()
#period after crash
RJFaft = web.DataReader('RJF', 'yahoo', crashend, end)
RJFaft['avgreturnafter'] = RJFaft['Close'].pct_change(1)
RJFaft['Cumulative Return After Crash'] = (1 + RJFaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
RF = web.DataReader('RF', 'yahoo', start, end)
RF['returns'] = RF['Close'].pct_change(1)
RF['Cumulative Return'] = (1 + RF['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
RFmean = RF['returns'].mean()
RFvar = RF['returns'].var()
RFkurt = RF['returns'].kurt()
RFskew = RF['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
RFbef = web.DataReader('RF', 'yahoo', start, crashstart)
RFbef['avgreturnbefore'] = RFbef['Close'].pct_change(1)
RFbef['Cumulative Return Before Crash'] = (1 + RFbef['avgreturnbefore']).cumprod()
#period of crash
RFdur = web.DataReader('RF', 'yahoo', crashstart, crashend)
RFdur['avgreturnduring'] = RFdur['Close'].pct_change(1)
RFdur['Cumulative Return During Crash'] = (1 + RFdur['avgreturnduring']).cumprod()
#period after crash
RFaft = web.DataReader('RF', 'yahoo', crashend, end)
RFaft['avgreturnafter'] = RFaft['Close'].pct_change(1)
RFaft['Cumulative Return After Crash'] = (1 + RFaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SPGI = web.DataReader('SPGI', 'yahoo', start, end)
SPGI['returns'] = SPGI['Close'].pct_change(1)
SPGI['Cumulative Return'] = (1 + SPGI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SPGImean = SPGI['returns'].mean()
SPGIvar = SPGI['returns'].var()
SPGIkurt = SPGI['returns'].kurt()
SPGIskew = SPGI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SPGIbef = web.DataReader('SPGI', 'yahoo', start, crashstart)
SPGIbef['avgreturnbefore'] = SPGIbef['Close'].pct_change(1)
SPGIbef['Cumulative Return Before Crash'] = (1 + SPGIbef['avgreturnbefore']).cumprod()
#period of crash
SPGIdur = web.DataReader('SPGI', 'yahoo', crashstart, crashend)
SPGIdur['avgreturnduring'] = SPGIdur['Close'].pct_change(1)
SPGIdur['Cumulative Return During Crash'] = (1 + SPGIdur['avgreturnduring']).cumprod()
#period after crash
SPGIaft = web.DataReader('SPGI', 'yahoo', crashend, end)
SPGIaft['avgreturnafter'] = SPGIaft['Close'].pct_change(1)
SPGIaft['Cumulative Return After Crash'] = (1 + SPGIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
STT = web.DataReader('STT', 'yahoo', start, end)
STT['returns'] = STT['Close'].pct_change(1)
STT['Cumulative Return'] = (1 + STT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
STTmean = STT['returns'].mean()
STTvar = STT['returns'].var()
STTkurt = STT['returns'].kurt()
STTskew = STT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
STTbef = web.DataReader('STT', 'yahoo', start, crashstart)
STTbef['avgreturnbefore'] = STTbef['Close'].pct_change(1)
STTbef['Cumulative Return Before Crash'] = (1 + STTbef['avgreturnbefore']).cumprod()
#period of crash
STTdur = web.DataReader('STT', 'yahoo', crashstart, crashend)
STTdur['avgreturnduring'] = STTdur['Close'].pct_change(1)
STTdur['Cumulative Return During Crash'] = (1 + STTdur['avgreturnduring']).cumprod()
#period after crash
STTaft = web.DataReader('STT', 'yahoo', crashend, end)
STTaft['avgreturnafter'] = STTaft['Close'].pct_change(1)
STTaft['Cumulative Return After Crash'] = (1 + STTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SIVB = web.DataReader('SIVB', 'yahoo', start, end)
SIVB['returns'] = SIVB['Close'].pct_change(1)
SIVB['Cumulative Return'] = (1 + SIVB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SIVBmean = SIVB['returns'].mean()
SIVBvar = SIVB['returns'].var()
SIVBkurt = SIVB['returns'].kurt()
SIVBskew = SIVB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SIVBbef = web.DataReader('SIVB', 'yahoo', start, crashstart)
SIVBbef['avgreturnbefore'] = SIVBbef['Close'].pct_change(1)
SIVBbef['Cumulative Return Before Crash'] = (1 + SIVBbef['avgreturnbefore']).cumprod()
#period of crash
SIVBdur = web.DataReader('SIVB', 'yahoo', crashstart, crashend)
SIVBdur['avgreturnduring'] = SIVBdur['Close'].pct_change(1)
SIVBdur['Cumulative Return During Crash'] = (1 + SIVBdur['avgreturnduring']).cumprod()
#period after crash
SIVBaft = web.DataReader('SIVB', 'yahoo', crashend, end)
SIVBaft['avgreturnafter'] = SIVBaft['Close'].pct_change(1)
SIVBaft['Cumulative Return After Crash'] = (1 + SIVBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SYF = web.DataReader('SYF', 'yahoo', start, end)
SYF['returns'] = SYF['Close'].pct_change(1)
SYF['Cumulative Return'] = (1 + SYF['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SYFmean = SYF['returns'].mean()
SYFvar = SYF['returns'].var()
SYFkurt = SYF['returns'].kurt()
SYFskew = SYF['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SYFbef = web.DataReader('SYF', 'yahoo', start, crashstart)
SYFbef['avgreturnbefore'] = SYFbef['Close'].pct_change(1)
SYFbef['Cumulative Return Before Crash'] = (1 + SYFbef['avgreturnbefore']).cumprod()
#period of crash
SYFdur = web.DataReader('SYF', 'yahoo', crashstart, crashend)
SYFdur['avgreturnduring'] = SYFdur['Close'].pct_change(1)
SYFdur['Cumulative Return During Crash'] = (1 + SYFdur['avgreturnduring']).cumprod()
#period after crash
SYFaft = web.DataReader('SYF', 'yahoo', crashend, end)
SYFaft['avgreturnafter'] = SYFaft['Close'].pct_change(1)
SYFaft['Cumulative Return After Crash'] = (1 + SYFaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TROW = web.DataReader('TROW', 'yahoo', start, end)
TROW['returns'] = TROW['Close'].pct_change(1)
TROW['Cumulative Return'] = (1 + TROW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TROWmean = TROW['returns'].mean()
TROWvar = TROW['returns'].var()
TROWkurt = TROW['returns'].kurt()
TROWskew = TROW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TROWbef = web.DataReader('TROW', 'yahoo', start, crashstart)
TROWbef['avgreturnbefore'] = TROWbef['Close'].pct_change(1)
TROWbef['Cumulative Return Before Crash'] = (1 + TROWbef['avgreturnbefore']).cumprod()
#period of crash
TROWdur = web.DataReader('TROW', 'yahoo', crashstart, crashend)
TROWdur['avgreturnduring'] = TROWdur['Close'].pct_change(1)
TROWdur['Cumulative Return During Crash'] = (1 + TROWdur['avgreturnduring']).cumprod()
#period after crash
TROWaft = web.DataReader('TROW', 'yahoo', crashend, end)
TROWaft['avgreturnafter'] = TROWaft['Close'].pct_change(1)
TROWaft['Cumulative Return After Crash'] = (1 + TROWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TRV = web.DataReader('TRV', 'yahoo', start, end)
TRV['returns'] = TRV['Close'].pct_change(1)
TRV['Cumulative Return'] = (1 + TRV['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TRVmean = TRV['returns'].mean()
TRVvar = TRV['returns'].var()
TRVkurt = TRV['returns'].kurt()
TRVskew = TRV['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TRVbef = web.DataReader('TRV', 'yahoo', start, crashstart)
TRVbef['avgreturnbefore'] = TRVbef['Close'].pct_change(1)
TRVbef['Cumulative Return Before Crash'] = (1 + TRVbef['avgreturnbefore']).cumprod()
#period of crash
TRVdur = web.DataReader('TRV', 'yahoo', crashstart, crashend)
TRVdur['avgreturnduring'] = TRVdur['Close'].pct_change(1)
TRVdur['Cumulative Return During Crash'] = (1 + TRVdur['avgreturnduring']).cumprod()
#period after crash
TRVaft = web.DataReader('TRV', 'yahoo', crashend, end)
TRVaft['avgreturnafter'] = TRVaft['Close'].pct_change(1)
TRVaft['Cumulative Return After Crash'] = (1 + TRVaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TFC = web.DataReader('TFC', 'yahoo', start, end)
TFC['returns'] = TFC['Close'].pct_change(1)
TFC['Cumulative Return'] = (1 + TFC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TFCmean = TFC['returns'].mean()
TFCvar = TFC['returns'].var()
TFCkurt = TFC['returns'].kurt()
TFCskew = TFC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TFCbef = web.DataReader('TFC', 'yahoo', start, crashstart)
TFCbef['avgreturnbefore'] = TFCbef['Close'].pct_change(1)
TFCbef['Cumulative Return Before Crash'] = (1 + TFCbef['avgreturnbefore']).cumprod()
#period of crash
TFCdur = web.DataReader('TFC', 'yahoo', crashstart, crashend)
TFCdur['avgreturnduring'] = TFCdur['Close'].pct_change(1)
TFCdur['Cumulative Return During Crash'] = (1 + TFCdur['avgreturnduring']).cumprod()
#period after crash
TFCaft = web.DataReader('TFC', 'yahoo', crashend, end)
TFCaft['avgreturnafter'] = TFCaft['Close'].pct_change(1)
TFCaft['Cumulative Return After Crash'] = (1 + TFCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
USB = web.DataReader('USB', 'yahoo', start, end)
USB['returns'] = USB['Close'].pct_change(1)
USB['Cumulative Return'] = (1 + USB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
USBmean = USB['returns'].mean()
USBvar = USB['returns'].var()
USBkurt = USB['returns'].kurt()
USBskew = USB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
USBbef = web.DataReader('USB', 'yahoo', start, crashstart)
USBbef['avgreturnbefore'] = USBbef['Close'].pct_change(1)
USBbef['Cumulative Return Before Crash'] = (1 + USBbef['avgreturnbefore']).cumprod()
#period of crash
USBdur = web.DataReader('USB', 'yahoo', crashstart, crashend)
USBdur['avgreturnduring'] = USBdur['Close'].pct_change(1)
USBdur['Cumulative Return During Crash'] = (1 + USBdur['avgreturnduring']).cumprod()
#period after crash
USBaft = web.DataReader('USB', 'yahoo', crashend, end)
USBaft['avgreturnafter'] = USBaft['Close'].pct_change(1)
USBaft['Cumulative Return After Crash'] = (1 + USBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
UNM = web.DataReader('UNM', 'yahoo', start, end)
UNM['returns'] = UNM['Close'].pct_change(1)
UNM['Cumulative Return'] = (1 + UNM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
UNMmean = UNM['returns'].mean()
UNMvar = UNM['returns'].var()
UNMkurt = UNM['returns'].kurt()
UNMskew = UNM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
UNMbef = web.DataReader('UNM', 'yahoo', start, crashstart)
UNMbef['avgreturnbefore'] = UNMbef['Close'].pct_change(1)
UNMbef['Cumulative Return Before Crash'] = (1 + UNMbef['avgreturnbefore']).cumprod()
#period of crash
UNMdur = web.DataReader('UNM', 'yahoo', crashstart, crashend)
UNMdur['avgreturnduring'] = UNMdur['Close'].pct_change(1)
UNMdur['Cumulative Return During Crash'] = (1 + UNMdur['avgreturnduring']).cumprod()
#period after crash
UNMaft = web.DataReader('UNM', 'yahoo', crashend, end)
UNMaft['avgreturnafter'] = UNMaft['Close'].pct_change(1)
UNMaft['Cumulative Return After Crash'] = (1 + UNMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WRB = web.DataReader('WRB', 'yahoo', start, end)
WRB['returns'] = WRB['Close'].pct_change(1)
WRB['Cumulative Return'] = (1 + WRB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WRBmean = WRB['returns'].mean()
WRBvar = WRB['returns'].var()
WRBkurt = WRB['returns'].kurt()
WRBskew = WRB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WRBbef = web.DataReader('WRB', 'yahoo', start, crashstart)
WRBbef['avgreturnbefore'] = WRBbef['Close'].pct_change(1)
WRBbef['Cumulative Return Before Crash'] = (1 + WRBbef['avgreturnbefore']).cumprod()
#period of crash
WRBdur = web.DataReader('WRB', 'yahoo', crashstart, crashend)
WRBdur['avgreturnduring'] = WRBdur['Close'].pct_change(1)
WRBdur['Cumulative Return During Crash'] = (1 + WRBdur['avgreturnduring']).cumprod()
#period after crash
WRBaft = web.DataReader('WRB', 'yahoo', crashend, end)
WRBaft['avgreturnafter'] = WRBaft['Close'].pct_change(1)
WRBaft['Cumulative Return After Crash'] = (1 + WRBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WFC = web.DataReader('WFC', 'yahoo', start, end)
WFC['returns'] = WFC['Close'].pct_change(1)
WFC['Cumulative Return'] = (1 + WFC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WFCmean = WFC['returns'].mean()
WFCvar = WFC['returns'].var()
WFCkurt = WFC['returns'].kurt()
WFCskew = WFC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WFCbef = web.DataReader('WFC', 'yahoo', start, crashstart)
WFCbef['avgreturnbefore'] = WFCbef['Close'].pct_change(1)
WFCbef['Cumulative Return Before Crash'] = (1 + WFCbef['avgreturnbefore']).cumprod()
#period of crash
WFCdur = web.DataReader('WFC', 'yahoo', crashstart, crashend)
WFCdur['avgreturnduring'] = WFCdur['Close'].pct_change(1)
WFCdur['Cumulative Return During Crash'] = (1 + WFCdur['avgreturnduring']).cumprod()
#period after crash
WFCaft = web.DataReader('WFC', 'yahoo', crashend, end)
WFCaft['avgreturnafter'] = WFCaft['Close'].pct_change(1)
WFCaft['Cumulative Return After Crash'] = (1 + WFCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WLTW = web.DataReader('WLTW', 'yahoo', start, end)
WLTW['returns'] = WLTW['Close'].pct_change(1)
WLTW['Cumulative Return'] = (1 + WLTW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WLTWmean = WLTW['returns'].mean()
WLTWvar = WLTW['returns'].var()
WLTWkurt = WLTW['returns'].kurt()
WLTWskew = WLTW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WLTWbef = web.DataReader('WLTW', 'yahoo', start, crashstart)
WLTWbef['avgreturnbefore'] = WLTWbef['Close'].pct_change(1)
WLTWbef['Cumulative Return Before Crash'] = (1 + WLTWbef['avgreturnbefore']).cumprod()
#period of crash
WLTWdur = web.DataReader('WLTW', 'yahoo', crashstart, crashend)
WLTWdur['avgreturnduring'] = WLTWdur['Close'].pct_change(1)
WLTWdur['Cumulative Return During Crash'] = (1 + WLTWdur['avgreturnduring']).cumprod()
#period after crash
WLTWaft = web.DataReader('WLTW', 'yahoo', crashend, end)
WLTWaft['avgreturnafter'] = WLTWaft['Close'].pct_change(1)
WLTWaft['Cumulative Return After Crash'] = (1 + WLTWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ZION = web.DataReader('ZION', 'yahoo', start, end)
ZION['returns'] = ZION['Close'].pct_change(1)
ZION['Cumulative Return'] = (1 + ZION['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ZIONmean = ZION['returns'].mean()
ZIONvar = ZION['returns'].var()
ZIONkurt = ZION['returns'].kurt()
ZIONskew = ZION['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ZIONbef = web.DataReader('ZION', 'yahoo', start, crashstart)
ZIONbef['avgreturnbefore'] = ZIONbef['Close'].pct_change(1)
ZIONbef['Cumulative Return Before Crash'] = (1 + ZIONbef['avgreturnbefore']).cumprod()
#period of crash
ZIONdur = web.DataReader('ZION', 'yahoo', crashstart, crashend)
ZIONdur['avgreturnduring'] = ZIONdur['Close'].pct_change(1)
ZIONdur['Cumulative Return During Crash'] = (1 + ZIONdur['avgreturnduring']).cumprod()
#period after crash
ZIONaft = web.DataReader('ZION', 'yahoo', crashend, end)
ZIONaft['avgreturnafter'] = ZIONaft['Close'].pct_change(1)
ZIONaft['Cumulative Return After Crash'] = (1 + ZIONaft['avgreturnafter']).cumprod()
#KDE Plot for Financials Sector
sp['returns'].plot(kind = 'kde', label ='S&P 500', alpha=0.5)
AFL['returns'].plot(kind = 'kde', label ='AFL', figsize = (10,8), alpha=0.5, title = 'KDE of Financials Stocks')
ALL['returns'].plot(kind = 'kde', label ='ALL', alpha=0.5)
AXP['returns'].plot(kind = 'kde', label ='AXP', alpha=0.5)
AIG['returns'].plot(kind = 'kde', label ='AIG', alpha=0.5)
AMP['returns'].plot(kind = 'kde', label ='AMP', alpha=0.5)
AON['returns'].plot(kind = 'kde', label ='AON', alpha=0.5)
AJG['returns'].plot(kind = 'kde', label ='AJG', alpha=0.5)
AIZ['returns'].plot(kind = 'kde', label ='AIZ', alpha=0.5)
BAC['returns'].plot(kind = 'kde', label ='BAC', alpha=0.5)
BK['returns'].plot(kind = 'kde', label ='BK', alpha=0.5)
BRKB['returns'].plot(kind = 'kde', label ='BRK.B', alpha=0.5)
BLK['returns'].plot(kind = 'kde', label ='BLK', alpha=0.5)
COF['returns'].plot(kind = 'kde', label ='COF', alpha=0.5)
CBOE['returns'].plot(kind = 'kde', label ='CBOE', alpha=0.5)
SCHW['returns'].plot(kind = 'kde', label = 'SCHW', alpha=0.5)
CB['returns'].plot(kind = 'kde', label ='CB', alpha=0.5)
CINF['returns'].plot(kind = 'kde', label ='CINF', alpha=0.5)
C['returns'].plot(kind = 'kde', label ='C', alpha=0.5)
CFG['returns'].plot(kind = 'kde', label ='CFG', alpha=0.5)
CME['returns'].plot(kind = 'kde', label ='CME', alpha=0.5)
CMA['returns'].plot(kind = 'kde', label ='CMA', alpha=0.5)
DFS['returns'].plot(kind = 'kde', label ='DFS', alpha=0.5)
ETFC['returns'].plot(kind = 'kde', label ='ETFC', alpha=0.5)
RE['returns'].plot(kind = 'kde', label ='RE', alpha=0.5)
FITB['returns'].plot(kind = 'kde', label ='FITB', alpha=0.5)
FRC['returns'].plot(kind = 'kde', label ='FRC', alpha=0.5)
BEN['returns'].plot(kind = 'kde', label ='BEN', alpha=0.5)
GL['returns'].plot(kind = 'kde', label ='GL', alpha=0.5)
GS['returns'].plot(kind = 'kde', label ='GS', alpha=0.5)
HIG['returns'].plot(kind = 'kde', label ='HIG', alpha=0.5)
HBAN['returns'].plot(kind = 'kde', label ='HBAN', alpha=0.5)
ICE['returns'].plot(kind = 'kde', label ='ICE', alpha=0.5)
IVZ['returns'].plot(kind = 'kde', label ='IVZ', alpha=0.5)
JPM['returns'].plot(kind = 'kde', label ='JPM', alpha=0.5)
KEY['returns'].plot(kind = 'kde', label ='KEY', alpha=0.5)
LNC['returns'].plot(kind = 'kde', label ='LNC', alpha=0.5)
L['returns'].plot(kind = 'kde', label ='L', alpha=0.5)
MTB['returns'].plot(kind = 'kde', label ='MTB', alpha=0.5)
MKTX['returns'].plot(kind = 'kde', label ='MKTX', alpha=0.5)
MMC['returns'].plot(kind = 'kde', label ='MMC', alpha=0.5)
MET['returns'].plot(kind = 'kde', label ='MET', alpha=0.5)
MCO['returns'].plot(kind = 'kde', label ='MCO', alpha=0.5)
MS['returns'].plot(kind = 'kde', label ='MS', alpha=0.5)
MSCI['returns'].plot(kind = 'kde', label ='MSCI', alpha=0.5)
NDAQ['returns'].plot(kind = 'kde', label ='NDAQ', alpha=0.5)
NTRS['returns'].plot(kind = 'kde', label ='NTRS', alpha=0.5)
PBCT['returns'].plot(kind = 'kde', label ='PBCT', alpha=0.5)
PNC['returns'].plot(kind = 'kde', label ='PNC', alpha=0.5)
PFG['returns'].plot(kind = 'kde', label ='PFG', alpha=0.5)
PGR['returns'].plot(kind = 'kde', label ='PGR', alpha=0.5)
PRU['returns'].plot(kind = 'kde', label ='PRU', alpha=0.5)
RJF['returns'].plot(kind = 'kde', label ='RJF', alpha=0.5)
RF['returns'].plot(kind = 'kde', label ='RF', alpha=0.5)
SPGI['returns'].plot(kind = 'kde', label ='SPGI', alpha=0.5)
STT['returns'].plot(kind = 'kde', label ='STT', alpha=0.5)
SIVB['returns'].plot(kind = 'kde', label ='SIVB', alpha=0.5)
SYF['returns'].plot(kind = 'kde', label ='SYF', alpha=0.5)
TROW['returns'].plot(kind = 'kde', label ='TROW', alpha=0.5)
TRV['returns'].plot(kind = 'kde', label ='TRV', alpha=0.5)
TFC['returns'].plot(kind = 'kde', label ='TFC', alpha=0.5)
USB['returns'].plot(kind = 'kde', label ='USB', alpha=0.5)
UNM['returns'].plot(kind = 'kde', label ='UNM', alpha=0.5)
WRB['returns'].plot(kind = 'kde', label ='WRB', alpha=0.5)
WFC['returns'].plot(kind = 'kde', label ='WFC', alpha=0.5)
WLTW['returns'].plot(kind = 'kde', label ='WLTW', alpha=0.5)
ZION['returns'].plot(kind = 'kde', label ='ZION', alpha=0.5)
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Boxplots comparing returns for Financials Sector
box_df = pd.concat([sp['returns'],AFL['returns'],ALL['returns'],AXP['returns'],AIG['returns'],AMP['returns'],AON['returns'],AJG['returns'],AIZ['returns'],BAC['returns'],BK['returns'],BRKB['returns'],BLK['returns'],COF['returns'],CBOE['returns'],SCHW['returns'],CB['returns'],CINF['returns'],C['returns'],CFG['returns'],CME['returns'],CMA['returns'],DFS['returns'],ETFC['returns'],RE['returns'],FITB['returns'],FRC['returns'],BEN['returns'],GL['returns'],GS['returns'],HIG['returns'],HBAN['returns'],ICE['returns'],IVZ['returns'],JPM['returns'],KEY['returns'],LNC['returns'],L['returns'],MTB['returns'],MKTX['returns'],MMC['returns'],MET['returns'],MCO['returns'],MS['returns'],MSCI['returns'],NDAQ['returns'],NTRS['returns'],PBCT['returns'],PNC['returns'],PFG['returns'],PGR['returns'],PRU['returns'],RJF['returns'],RF['returns'],SPGI['returns'],STT['returns'],SIVB['returns'],SYF['returns'],TROW['returns'],TRV['returns'],TFC['returns'],USB['returns'],UNM['returns'],WRB['returns'],WFC['returns'],WLTW['returns'],ZION['returns']], axis=1)
box_df.columns = ['S&P 500','AFL','ALL','AXP','AIG','AMP','AON','AJG','AIZ','BAC','BK','BRK.B','BLK','COF','CBOE','SCHW','CB','CINF','C','CFG','CME','CMA','DFS','ETFC','RE','FITB','FRC','BEN','GL','GS','HIG','HBAN','ICE','IVZ','JPM','KEY','LNC','L','MTB','MKTX','MMC','MET','MCO','MS','MSCI','NDAQ','NTRS','PBCT','PNC','PFG','PGR','PRU','RJF','RF','SPGI','STT','SIVB','SYF','TROW','TRV','TFC','USB','UNM','WRB','WFC','WLTW','ZION']
box_df.plot(kind='box', figsize=(30,10), colormap= 'jet', title = 'Boxplots of Financials Sector Returns')
#Cumulative Returns of Financials Stocks for Whole period
sp['Cumulative Return'].plot(label="S&P 500")
AFL['Cumulative Return'].plot(label='AFL', figsize=(16,8), title = 'Cumulative Return of Financials Stocks')
ALL['Cumulative Return'].plot(label="ALL")
AXP['Cumulative Return'].plot(label="AXP")
AIG['Cumulative Return'].plot(label="AIG")
AMP['Cumulative Return'].plot(label="AMP")
AON['Cumulative Return'].plot(label="AON")
AJG['Cumulative Return'].plot(label="AJG")
AIZ['Cumulative Return'].plot(label="AIZ")
BAC['Cumulative Return'].plot(label="BAC")
BK['Cumulative Return'].plot(label="BK")
BRKB['Cumulative Return'].plot(label="BRK.B")
BLK['Cumulative Return'].plot(label="BLK")
COF['Cumulative Return'].plot(label="COF")
CBOE['Cumulative Return'].plot(label="CBOE")
SCHW['Cumulative Return'].plot(label="SCHW")
CB['Cumulative Return'].plot(label="CB")
CINF['Cumulative Return'].plot(label="CINF")
C['Cumulative Return'].plot(label="C")
CFG['Cumulative Return'].plot(label="CFG")
CME['Cumulative Return'].plot(label="CME")
CMA['Cumulative Return'].plot(label="CMA")
DFS['Cumulative Return'].plot(label="DFS")
ETFC['Cumulative Return'].plot(label="ETFC")
RE['Cumulative Return'].plot(label="RE")
FITB['Cumulative Return'].plot(label="FITB")
FRC['Cumulative Return'].plot(label="FRC")
BEN['Cumulative Return'].plot(label="BEN")
GL['Cumulative Return'].plot(label="GL")
GS['Cumulative Return'].plot(label="GS")
HIG['Cumulative Return'].plot(label="HIG")
HBAN['Cumulative Return'].plot(label="HBAN")
ICE['Cumulative Return'].plot(label="ICE")
IVZ['Cumulative Return'].plot(label="IVZ")
JPM['Cumulative Return'].plot(label="JPM")
KEY['Cumulative Return'].plot(label="KEY")
LNC['Cumulative Return'].plot(label="LNC")
L['Cumulative Return'].plot(label="L")
MTB['Cumulative Return'].plot(label="MTB")
MKTX['Cumulative Return'].plot(label="MKTX")
MMC['Cumulative Return'].plot(label="MMC")
MET['Cumulative Return'].plot(label="MET")
MCO['Cumulative Return'].plot(label="MCO")
MS['Cumulative Return'].plot(label="MS")
MSCI['Cumulative Return'].plot(label="MSCI")
NDAQ['Cumulative Return'].plot(label="NDAQ")
NTRS['Cumulative Return'].plot(label="NTRS")
PBCT['Cumulative Return'].plot(label="PBCT")
PNC['Cumulative Return'].plot(label="PNC")
PFG['Cumulative Return'].plot(label="PFG")
PGR['Cumulative Return'].plot(label="PGR")
PRU['Cumulative Return'].plot(label="PRU")
RJF['Cumulative Return'].plot(label="RJF")
RF['Cumulative Return'].plot(label="RF")
SPGI['Cumulative Return'].plot(label="SPGI")
STT['Cumulative Return'].plot(label="STT")
SIVB['Cumulative Return'].plot(label="SIVB")
SYF['Cumulative Return'].plot(label="SYF")
TROW['Cumulative Return'].plot(label="TROW")
TRV['Cumulative Return'].plot(label="TRV")
TFC['Cumulative Return'].plot(label="TFC")
USB['Cumulative Return'].plot(label="USB")
UNM['Cumulative Return'].plot(label="UNM")
WRB['Cumulative Return'].plot(label="WRB")
WFC['Cumulative Return'].plot(label="WFC")
WLTW['Cumulative Return'].plot(label="WLTW")
ZION['Cumulative Return'].plot(label="ZION")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Sorting by Cumulative Return
cumret = {'Cumulative Returns 12/4-6/5': [sp['Cumulative Return'].iloc[-1],AFL['Cumulative Return'].iloc[-1],ALL['Cumulative Return'].iloc[-1],AXP['Cumulative Return'].iloc[-1],AIG['Cumulative Return'].iloc[-1],AMP['Cumulative Return'].iloc[-1],AON['Cumulative Return'].iloc[-1],AJG['Cumulative Return'].iloc[-1],AIZ['Cumulative Return'].iloc[-1],BAC['Cumulative Return'].iloc[-1],BK['Cumulative Return'].iloc[-1],BRKB['Cumulative Return'].iloc[-1],BLK['Cumulative Return'].iloc[-1],COF['Cumulative Return'].iloc[-1],CBOE['Cumulative Return'].iloc[-1],SCHW['Cumulative Return'].iloc[-1],CB['Cumulative Return'].iloc[-1],CINF['Cumulative Return'].iloc[-1],C['Cumulative Return'].iloc[-1],CFG['Cumulative Return'].iloc[-1],CME['Cumulative Return'].iloc[-1],CMA['Cumulative Return'].iloc[-1],DFS['Cumulative Return'].iloc[-1],ETFC['Cumulative Return'].iloc[-1],RE['Cumulative Return'].iloc[-1],FITB['Cumulative Return'].iloc[-1],FRC['Cumulative Return'].iloc[-1],BEN['Cumulative Return'].iloc[-1],GL['Cumulative Return'].iloc[-1],GS['Cumulative Return'].iloc[-1],HIG['Cumulative Return'].iloc[-1],HBAN['Cumulative Return'].iloc[-1],ICE['Cumulative Return'].iloc[-1],IVZ['Cumulative Return'].iloc[-1],JPM['Cumulative Return'].iloc[-1],KEY['Cumulative Return'].iloc[-1],LNC['Cumulative Return'].iloc[-1],L['Cumulative Return'].iloc[-1],MTB['Cumulative Return'].iloc[-1],MKTX['Cumulative Return'].iloc[-1],MMC['Cumulative Return'].iloc[-1],MET['Cumulative Return'].iloc[-1],MCO['Cumulative Return'].iloc[-1],MS['Cumulative Return'].iloc[-1],MSCI['Cumulative Return'].iloc[-1],NDAQ['Cumulative Return'].iloc[-1],NTRS['Cumulative Return'].iloc[-1],PBCT['Cumulative Return'].iloc[-1],PNC['Cumulative Return'].iloc[-1],PFG['Cumulative Return'].iloc[-1],PGR['Cumulative Return'].iloc[-1],PRU['Cumulative Return'].iloc[-1],RJF['Cumulative Return'].iloc[-1],RF['Cumulative Return'].iloc[-1],SPGI['Cumulative Return'].iloc[-1],STT['Cumulative Return'].iloc[-1],SIVB['Cumulative Return'].iloc[-1],SYF['Cumulative Return'].iloc[-1],TROW['Cumulative Return'].iloc[-1],TRV['Cumulative Return'].iloc[-1],TFC['Cumulative Return'].iloc[-1],USB['Cumulative Return'].iloc[-1],UNM['Cumulative Return'].iloc[-1],WRB['Cumulative Return'].iloc[-1],WFC['Cumulative Return'].iloc[-1],WLTW['Cumulative Return'].iloc[-1],ZION['Cumulative Return'].iloc[-1]],
'Cumulative Returns 12/4-2/20': [spbef['Cumulative Return Before Crash'].iloc[-1],AFLbef['Cumulative Return Before Crash'].iloc[-1],ALLbef['Cumulative Return Before Crash'].iloc[-1],AXPbef['Cumulative Return Before Crash'].iloc[-1],AIGbef['Cumulative Return Before Crash'].iloc[-1],AMPbef['Cumulative Return Before Crash'].iloc[-1],AONbef['Cumulative Return Before Crash'].iloc[-1],AJGbef['Cumulative Return Before Crash'].iloc[-1],AIZbef['Cumulative Return Before Crash'].iloc[-1],BACbef['Cumulative Return Before Crash'].iloc[-1],BKbef['Cumulative Return Before Crash'].iloc[-1],BRKBbef['Cumulative Return Before Crash'].iloc[-1],BLKbef['Cumulative Return Before Crash'].iloc[-1],COFbef['Cumulative Return Before Crash'].iloc[-1],CBOEbef['Cumulative Return Before Crash'].iloc[-1],SCHWbef['Cumulative Return Before Crash'].iloc[-1],CBbef['Cumulative Return Before Crash'].iloc[-1],CINFbef['Cumulative Return Before Crash'].iloc[-1],Cbef['Cumulative Return Before Crash'].iloc[-1],CFGbef['Cumulative Return Before Crash'].iloc[-1],CMEbef['Cumulative Return Before Crash'].iloc[-1],CMAbef['Cumulative Return Before Crash'].iloc[-1],DFSbef['Cumulative Return Before Crash'].iloc[-1],ETFCbef['Cumulative Return Before Crash'].iloc[-1],REbef['Cumulative Return Before Crash'].iloc[-1],FITBbef['Cumulative Return Before Crash'].iloc[-1],FRCbef['Cumulative Return Before Crash'].iloc[-1],BENbef['Cumulative Return Before Crash'].iloc[-1],GLbef['Cumulative Return Before Crash'].iloc[-1],GSbef['Cumulative Return Before Crash'].iloc[-1],HIGbef['Cumulative Return Before Crash'].iloc[-1],HBANbef['Cumulative Return Before Crash'].iloc[-1],ICEbef['Cumulative Return Before Crash'].iloc[-1],IVZbef['Cumulative Return Before Crash'].iloc[-1],JPMbef['Cumulative Return Before Crash'].iloc[-1],KEYbef['Cumulative Return Before Crash'].iloc[-1],LNCbef['Cumulative Return Before Crash'].iloc[-1],Lbef['Cumulative Return Before Crash'].iloc[-1],MTBbef['Cumulative Return Before Crash'].iloc[-1],MKTXbef['Cumulative Return Before Crash'].iloc[-1],MMCbef['Cumulative Return Before Crash'].iloc[-1],METbef['Cumulative Return Before Crash'].iloc[-1],MCObef['Cumulative Return Before Crash'].iloc[-1],MSbef['Cumulative Return Before Crash'].iloc[-1],MSCIbef['Cumulative Return Before Crash'].iloc[-1],NDAQbef['Cumulative Return Before Crash'].iloc[-1],NTRSbef['Cumulative Return Before Crash'].iloc[-1],PBCTbef['Cumulative Return Before Crash'].iloc[-1],PNCbef['Cumulative Return Before Crash'].iloc[-1],PFGbef['Cumulative Return Before Crash'].iloc[-1],PGRbef['Cumulative Return Before Crash'].iloc[-1],PRUbef['Cumulative Return Before Crash'].iloc[-1],RJFbef['Cumulative Return Before Crash'].iloc[-1],RFbef['Cumulative Return Before Crash'].iloc[-1],SPGIbef['Cumulative Return Before Crash'].iloc[-1],STTbef['Cumulative Return Before Crash'].iloc[-1],SIVBbef['Cumulative Return Before Crash'].iloc[-1],SYFbef['Cumulative Return Before Crash'].iloc[-1],TROWbef['Cumulative Return Before Crash'].iloc[-1],TRVbef['Cumulative Return Before Crash'].iloc[-1],TFCbef['Cumulative Return Before Crash'].iloc[-1],USBbef['Cumulative Return Before Crash'].iloc[-1],UNMbef['Cumulative Return Before Crash'].iloc[-1],WRBbef['Cumulative Return Before Crash'].iloc[-1],WFCbef['Cumulative Return Before Crash'].iloc[-1],WLTWbef['Cumulative Return Before Crash'].iloc[-1],ZIONbef['Cumulative Return Before Crash'].iloc[-1]],
'Cumulative Returns 2/20-3/23': [spdur['Cumulative Return During Crash'].iloc[-1],AFLdur['Cumulative Return During Crash'].iloc[-1],ALLdur['Cumulative Return During Crash'].iloc[-1],AXPdur['Cumulative Return During Crash'].iloc[-1],AIGdur['Cumulative Return During Crash'].iloc[-1],AMPdur['Cumulative Return During Crash'].iloc[-1],AONdur['Cumulative Return During Crash'].iloc[-1],AJGdur['Cumulative Return During Crash'].iloc[-1],AIZdur['Cumulative Return During Crash'].iloc[-1],BACdur['Cumulative Return During Crash'].iloc[-1],BKdur['Cumulative Return During Crash'].iloc[-1],BRKBdur['Cumulative Return During Crash'].iloc[-1],BLKdur['Cumulative Return During Crash'].iloc[-1],COFdur['Cumulative Return During Crash'].iloc[-1],CBOEdur['Cumulative Return During Crash'].iloc[-1],SCHWdur['Cumulative Return During Crash'].iloc[-1],CBdur['Cumulative Return During Crash'].iloc[-1],CINFdur['Cumulative Return During Crash'].iloc[-1],Cdur['Cumulative Return During Crash'].iloc[-1],CFGdur['Cumulative Return During Crash'].iloc[-1],CMEdur['Cumulative Return During Crash'].iloc[-1],CMAdur['Cumulative Return During Crash'].iloc[-1],DFSdur['Cumulative Return During Crash'].iloc[-1],ETFCdur['Cumulative Return During Crash'].iloc[-1],REdur['Cumulative Return During Crash'].iloc[-1],FITBdur['Cumulative Return During Crash'].iloc[-1],FRCdur['Cumulative Return During Crash'].iloc[-1],BENdur['Cumulative Return During Crash'].iloc[-1],GLdur['Cumulative Return During Crash'].iloc[-1],GSdur['Cumulative Return During Crash'].iloc[-1],HIGdur['Cumulative Return During Crash'].iloc[-1],HBANdur['Cumulative Return During Crash'].iloc[-1],ICEdur['Cumulative Return During Crash'].iloc[-1],IVZdur['Cumulative Return During Crash'].iloc[-1],JPMdur['Cumulative Return During Crash'].iloc[-1],KEYdur['Cumulative Return During Crash'].iloc[-1],LNCdur['Cumulative Return During Crash'].iloc[-1],Ldur['Cumulative Return During Crash'].iloc[-1],MTBdur['Cumulative Return During Crash'].iloc[-1],MKTXdur['Cumulative Return During Crash'].iloc[-1],MMCdur['Cumulative Return During Crash'].iloc[-1],METdur['Cumulative Return During Crash'].iloc[-1],MCOdur['Cumulative Return During Crash'].iloc[-1],MSdur['Cumulative Return During Crash'].iloc[-1],MSCIdur['Cumulative Return During Crash'].iloc[-1],NDAQdur['Cumulative Return During Crash'].iloc[-1],NTRSdur['Cumulative Return During Crash'].iloc[-1],PBCTdur['Cumulative Return During Crash'].iloc[-1],PNCdur['Cumulative Return During Crash'].iloc[-1],PFGdur['Cumulative Return During Crash'].iloc[-1],PGRdur['Cumulative Return During Crash'].iloc[-1],PRUdur['Cumulative Return During Crash'].iloc[-1],RJFdur['Cumulative Return During Crash'].iloc[-1],RFdur['Cumulative Return During Crash'].iloc[-1],SPGIdur['Cumulative Return During Crash'].iloc[-1],STTdur['Cumulative Return During Crash'].iloc[-1],SIVBdur['Cumulative Return During Crash'].iloc[-1],SYFdur['Cumulative Return During Crash'].iloc[-1],TROWdur['Cumulative Return During Crash'].iloc[-1],TRVdur['Cumulative Return During Crash'].iloc[-1],TFCdur['Cumulative Return During Crash'].iloc[-1],USBdur['Cumulative Return During Crash'].iloc[-1],UNMdur['Cumulative Return During Crash'].iloc[-1],WRBdur['Cumulative Return During Crash'].iloc[-1],WFCdur['Cumulative Return During Crash'].iloc[-1],WLTWdur['Cumulative Return During Crash'].iloc[-1],ZIONdur['Cumulative Return During Crash'].iloc[-1]],
'Cumulative Returns 3/23-6/5': [spaft['Cumulative Return After Crash'].iloc[-1],AFLaft['Cumulative Return After Crash'].iloc[-1],ALLaft['Cumulative Return After Crash'].iloc[-1],AXPaft['Cumulative Return After Crash'].iloc[-1],AIGaft['Cumulative Return After Crash'].iloc[-1],AMPaft['Cumulative Return After Crash'].iloc[-1],AONaft['Cumulative Return After Crash'].iloc[-1],AJGaft['Cumulative Return After Crash'].iloc[-1],AIZaft['Cumulative Return After Crash'].iloc[-1],BACaft['Cumulative Return After Crash'].iloc[-1],BKaft['Cumulative Return After Crash'].iloc[-1],BRKBaft['Cumulative Return After Crash'].iloc[-1],BLKaft['Cumulative Return After Crash'].iloc[-1],COFaft['Cumulative Return After Crash'].iloc[-1],CBOEaft['Cumulative Return After Crash'].iloc[-1],SCHWaft['Cumulative Return After Crash'].iloc[-1],CBaft['Cumulative Return After Crash'].iloc[-1],CINFaft['Cumulative Return After Crash'].iloc[-1],Caft['Cumulative Return After Crash'].iloc[-1],CFGaft['Cumulative Return After Crash'].iloc[-1],CMEaft['Cumulative Return After Crash'].iloc[-1],CMAaft['Cumulative Return After Crash'].iloc[-1],DFSaft['Cumulative Return After Crash'].iloc[-1],ETFCaft['Cumulative Return After Crash'].iloc[-1],REaft['Cumulative Return After Crash'].iloc[-1],FITBaft['Cumulative Return After Crash'].iloc[-1],FRCaft['Cumulative Return After Crash'].iloc[-1],BENaft['Cumulative Return After Crash'].iloc[-1],GLaft['Cumulative Return After Crash'].iloc[-1],GSaft['Cumulative Return After Crash'].iloc[-1],HIGaft['Cumulative Return After Crash'].iloc[-1],HBANaft['Cumulative Return After Crash'].iloc[-1],ICEaft['Cumulative Return After Crash'].iloc[-1],IVZaft['Cumulative Return After Crash'].iloc[-1],JPMaft['Cumulative Return After Crash'].iloc[-1],KEYaft['Cumulative Return After Crash'].iloc[-1],LNCaft['Cumulative Return After Crash'].iloc[-1],Laft['Cumulative Return After Crash'].iloc[-1],MTBaft['Cumulative Return After Crash'].iloc[-1],MKTXaft['Cumulative Return After Crash'].iloc[-1],MMCaft['Cumulative Return After Crash'].iloc[-1],METaft['Cumulative Return After Crash'].iloc[-1],MCOaft['Cumulative Return After Crash'].iloc[-1],MSaft['Cumulative Return After Crash'].iloc[-1],MSCIaft['Cumulative Return After Crash'].iloc[-1],NDAQaft['Cumulative Return After Crash'].iloc[-1],NTRSaft['Cumulative Return After Crash'].iloc[-1],PBCTaft['Cumulative Return After Crash'].iloc[-1],PNCaft['Cumulative Return After Crash'].iloc[-1],PFGaft['Cumulative Return After Crash'].iloc[-1],PGRaft['Cumulative Return After Crash'].iloc[-1],PRUaft['Cumulative Return After Crash'].iloc[-1],RJFaft['Cumulative Return After Crash'].iloc[-1],RFaft['Cumulative Return After Crash'].iloc[-1],SPGIaft['Cumulative Return After Crash'].iloc[-1],STTaft['Cumulative Return After Crash'].iloc[-1],SIVBaft['Cumulative Return After Crash'].iloc[-1],SYFaft['Cumulative Return After Crash'].iloc[-1],TROWaft['Cumulative Return After Crash'].iloc[-1],TRVaft['Cumulative Return After Crash'].iloc[-1],TFCaft['Cumulative Return After Crash'].iloc[-1],USBaft['Cumulative Return After Crash'].iloc[-1],UNMaft['Cumulative Return After Crash'].iloc[-1],WRBaft['Cumulative Return After Crash'].iloc[-1],WFCaft['Cumulative Return After Crash'].iloc[-1],WLTWaft['Cumulative Return After Crash'].iloc[-1],ZIONaft['Cumulative Return After Crash'].iloc[-1]]}
fdf2 = pd.DataFrame(cumret, columns = ['Cumulative Returns 12/4-6/5', 'Cumulative Returns 12/4-2/20', 'Cumulative Returns 2/20-3/23', 'Cumulative Returns 3/23-6/5'], index= ['S&P 500','AFL','ALL','AXP','AIG','AMP','AON','AJG','AIZ','BAC','BK','BRK.B','BLK','COF','CBOE','SCHW','CB','CINF','C','CFG','CME','CMA','DFS','ETFC','RE','FITB','FRC','BEN','GL','GS','HIG','HBAN','ICE','IVZ','JPM','KEY','LNC','L','MTB','MKTX','MMC','MET','MCO','MS','MSCI','NDAQ','NTRS','PBCT','PNC','PFG','PGR','PRU','RJF','RF','SPGI','STT','SIVB','SYF','TROW','TRV','TFC','USB','UNM','WRB','WFC','WLTW','ZION'])
pd.DataFrame(fdf2)
fdf2.sort_values('Cumulative Returns 3/23-6/5', ascending=False)
#Table of Key Statistics of Financials Stocks
import pandas as pd
import statistics as stats
fmeans = [AFLmean,ALLmean,AXPmean,AIGmean,AMPmean,AONmean,AJGmean,AIZmean,BACmean,BKmean,BRKBmean,BLKmean,COFmean,CBOEmean,SCHWmean,CBmean,CINFmean,Cmean,CFGmean,CMEmean,CMAmean,DFSmean,ETFCmean,REmean,FITBmean,FRCmean,BENmean,GLmean,GSmean,HIGmean,HBANmean,ICEmean,IVZmean,JPMmean,KEYmean,LNCmean,Lmean,MTBmean,MKTXmean,MMCmean,METmean,MCOmean,MSmean,MSCImean,NDAQmean,NTRSmean,PBCTmean,PNCmean,PFGmean,PGRmean,PRUmean,RJFmean,RFmean,SPGImean,STTmean,SIVBmean,SYFmean,TROWmean,TRVmean,TFCmean,USBmean,UNMmean,WRBmean,WFCmean,WLTWmean,ZIONmean]
faveragemean = stats.mean(fmeans)
fvariances = [AFLvar,ALLvar,AXPvar,AIGvar,AMPvar,AONvar,AJGvar,AIZvar,BACvar,BKvar,BRKBvar,BLKvar,COFvar,CBOEvar,SCHWvar,CBvar,CINFvar,Cvar,CFGvar,CMEvar,CMAvar,DFSvar,ETFCvar,REvar,FITBvar,FRCvar,BENvar,GLvar,GSvar,HIGvar,HBANvar,ICEvar,IVZvar,JPMvar,KEYvar,LNCvar,Lvar,MTBvar,MKTXvar,MMCvar,METvar,MCOvar,MSvar,MSCIvar,NDAQvar,NTRSvar,PBCTvar,PNCvar,PFGvar,PGRvar,PRUvar,RJFvar,RFvar,SPGIvar,STTvar,SIVBvar,SYFvar,TROWvar,TRVvar,TFCvar,USBvar,UNMvar,WRBvar,WFCvar,WLTWvar,ZIONvar]
faveragevar = stats.mean(fvariances)
fkurtoses = [AFLkurt,ALLkurt,AXPkurt,AIGkurt,AMPkurt,AONkurt,AJGkurt,AIZkurt,BACkurt,BKkurt,BRKBkurt,BLKkurt,COFkurt,CBOEkurt,SCHWkurt,CBkurt,CINFkurt,Ckurt,CFGkurt,CMEkurt,CMAkurt,DFSkurt,ETFCkurt,REkurt,FITBkurt,FRCkurt,BENkurt,GLkurt,GSkurt,HIGkurt,HBANkurt,ICEkurt,IVZkurt,JPMkurt,KEYkurt,LNCkurt,Lkurt,MTBkurt,MKTXkurt,MMCkurt,METkurt,MCOkurt,MSkurt,MSCIkurt,NDAQkurt,NTRSkurt,PBCTkurt,PNCkurt,PFGkurt,PGRkurt,PRUkurt,RJFkurt,RFkurt,SPGIkurt,STTkurt,SIVBkurt,SYFkurt,TROWkurt,TRVkurt,TFCkurt,USBkurt,UNMkurt,WRBkurt,WFCkurt,WLTWkurt,ZIONkurt]
faveragekurt = stats.mean(fkurtoses)
fskews = [AFLskew,ALLskew,AXPskew,AIGskew,AMPskew,AONskew,AJGskew,AIZskew,BACskew,BKskew,BRKBskew,BLKskew,COFskew,CBOEskew,SCHWskew,CBskew,CINFskew,Cskew,CFGskew,CMEskew,CMAskew,DFSskew,ETFCskew,REskew,FITBskew,FRCskew,BENskew,GLskew,GSskew,HIGskew,HBANskew,ICEskew,IVZskew,JPMskew,KEYskew,LNCskew,Lskew,MTBskew,MKTXskew,MMCskew,METskew,MCOskew,MSskew,MSCIskew,NDAQskew,NTRSskew,PBCTskew,PNCskew,PFGskew,PGRskew,PRUskew,RJFskew,RFskew,SPGIskew,STTskew,SIVBskew,SYFskew,TROWskew,TRVskew,TFCskew,USBskew,UNMskew,WRBskew,WFCskew,WLTWskew,ZIONskew]
faverageskew = stats.mean(fskews)
Financials = {'Mean': [[spmean],[faveragemean],[AFLmean], [ALLmean],[AXPmean],[AIGmean],[AMPmean],[AONmean],[AJGmean],[AIZmean],[BACmean],[BKmean],[BRKBmean],[BLKmean],[COFmean],[CBOEmean],[SCHWmean],[CBmean],[CINFmean],[Cmean],[CFGmean],[CMEmean],[CMAmean],[DFSmean],[ETFCmean],[REmean],[FITBmean],[FRCmean],[BENmean],[GLmean], [GSmean],[HIGmean],[HBANmean],[ICEmean],[IVZmean],[JPMmean],[KEYmean],[LNCmean],[Lmean],[MTBmean],[MKTXmean],[MMCmean],[METmean],[MCOmean],[MSmean],[MSCImean],[NDAQmean],[NTRSmean],[PBCTmean],[PNCmean],[PFGmean],[PGRmean],[PRUmean],[RJFmean],[RFmean],[SPGImean],[STTmean],[SIVBmean],[SYFmean],[TROWmean],[TRVmean],[TFCmean],[USBmean],[UNMmean],[WRBmean],[WFCmean],[WLTWmean],[ZIONmean]],
'Variance': [[spvar],[faveragevar],[AFLvar],[ALLvar],[AXPvar],[AIGvar],[AMPvar],[AONvar],[AJGvar],[AIZvar],[BACvar],[BKvar],[BRKBvar],[BLKvar],[COFvar],[CBOEvar],[SCHWvar],[CBvar],[CINFvar],[Cvar],[CFGvar],[CMEvar],[CMAvar],[DFSvar],[ETFCvar],[REvar],[FITBvar],[FRCvar],[BENvar],[GLvar],[GSvar],[HIGvar],[HBANvar],[ICEvar],[IVZvar],[JPMvar],[KEYvar],[LNCvar],[Lvar],[MTBvar],[MKTXvar],[MMCvar],[METvar],[MCOvar],[MSvar],[MSCIvar],[NDAQvar],[NTRSvar],[PBCTvar],[PNCvar],[PFGvar],[PGRvar],[PRUvar],[RJFvar],[RFvar],[SPGIvar],[STTvar],[SIVBvar],[SYFvar],[TROWvar],[TRVvar],[TFCvar],[USBvar],[UNMvar],[WRBvar],[WFCvar],[WLTWvar],[ZIONvar]],
'Kurtosis': [[spkurt],[faveragekurt],[AFLkurt],[ALLkurt],[AXPkurt],[AIGkurt],[AMPkurt],[AONkurt],[AJGkurt],[AIZkurt],[BACkurt],[BKkurt],[BRKBkurt],[BLKkurt],[COFkurt],[CBOEkurt],[SCHWkurt],[CBkurt],[CINFkurt],[Ckurt],[CFGkurt],[CMEkurt],[CMAkurt],[DFSkurt],[ETFCkurt],[REkurt],[FITBkurt],[FRCkurt],[BENkurt],[GLkurt],[GSkurt],[HIGkurt],[HBANkurt],[ICEkurt],[IVZkurt],[JPMkurt],[KEYkurt],[LNCkurt],[Lkurt],[MTBkurt],[MKTXkurt],[MMCkurt],[METkurt],[MCOkurt],[MSkurt],[MSCIkurt],[NDAQkurt],[NTRSkurt],[PBCTkurt],[PNCkurt],[PFGkurt],[PGRkurt],[PRUkurt],[RJFkurt],[RFkurt],[SPGIkurt],[STTkurt],[SIVBkurt],[SYFkurt],[TROWkurt],[TRVkurt],[TFCkurt],[USBkurt],[UNMkurt],[WRBkurt],[WFCkurt],[WLTWkurt],[ZIONkurt]],
'Skew': [[spskew],[faverageskew],[AFLskew],[ALLskew],[AXPskew],[AIGskew],[AMPskew],[AONskew],[AJGskew],[AIZskew],[BACskew],[BKskew],[BRKBskew],[BLKskew],[COFskew],[CBOEskew],[SCHWskew],[CBskew],[CINFskew],[Cskew],[CFGskew],[CMEskew],[CMAskew],[DFSskew],[ETFCskew],[REskew],[FITBskew],[FRCskew],[BENskew],[GLskew],[GSskew],[HIGskew],[HBANskew],[ICEskew],[IVZskew],[JPMskew],[KEYskew],[LNCskew],[Lskew],[MTBskew],[MKTXskew],[MMCskew],[METskew],[MCOskew],[MSskew],[MSCIskew],[NDAQskew],[NTRSskew],[PBCTskew],[PNCskew],[PFGskew],[PGRskew],[PRUskew],[RJFskew],[RFskew],[SPGIskew],[STTskew],[SIVBskew],[SYFskew],[TROWskew],[TRVskew],[TFCskew],[USBskew],[UNMskew],[WRBskew],[WFCskew],[WLTWskew],[ZIONskew]],
}
fdf = pd.DataFrame(Financials, columns = ['Mean', 'Variance', 'Kurtosis', 'Skew'], index= ['S&P 500','Average','AFL','ALL','AXP','AIG','AMP','AONcon','AJG','AIZ','BAC','BK','BRK.B','BLK','COF','CBOE','SCHW','CB','CINF','C','CFG','CME','CMA','DFS','ETFC','RE','FITB','FRC','BEN','GL','GS','HIG','HBAN','ICE','IVZ','JPM','KEY','LNC','L','MTB','MKTX','MMC','MET','MCO','MS','MSCI','NDAQ','NTRS','PBCT','PNC','PFG','PGR','PRU','RJF','RF','SPGI','STT','SIVB','SYF','TROW','TRV','TFC','USB','UNM','WRB','WFC','WLTW','ZION']
)
pd.DataFrame(fdf)
fdf.sort_values("Mean", ascending=False)
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ACN = web.DataReader('ACN', 'yahoo', start, end)
ACN['returns'] = ACN['Close'].pct_change(1)
ACN['Cumulative Return'] = (1 + ACN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ACNmean = ACN['returns'].mean()
ACNvar = ACN['returns'].var()
ACNkurt = ACN['returns'].kurt()
ACNskew = ACN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ACNbef = web.DataReader('ACN', 'yahoo', start, crashstart)
ACNbef['avgreturnbefore'] = ACNbef['Close'].pct_change(1)
ACNbef['Cumulative Return Before Crash'] = (1 + ACNbef['avgreturnbefore']).cumprod()
#period of crash
ACNdur = web.DataReader('ACN', 'yahoo', crashstart, crashend)
ACNdur['avgreturnduring'] = ACNdur['Close'].pct_change(1)
ACNdur['Cumulative Return During Crash'] = (1 + ACNdur['avgreturnduring']).cumprod()
#period after crash
ACNaft = web.DataReader('ACN', 'yahoo', crashend, end)
ACNaft['avgreturnafter'] = ACNaft['Close'].pct_change(1)
ACNaft['Cumulative Return After Crash'] = (1 + ACNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ADBE = web.DataReader('ADBE', 'yahoo', start, end)
ADBE['returns'] = ADBE['Close'].pct_change(1)
ADBE['Cumulative Return'] = (1 + ADBE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ADBEmean = ADBE['returns'].mean()
ADBEvar = ADBE['returns'].var()
ADBEkurt = ADBE['returns'].kurt()
ADBEskew = ADBE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ADBEbef = web.DataReader('ADBE', 'yahoo', start, crashstart)
ADBEbef['avgreturnbefore'] = ADBEbef['Close'].pct_change(1)
ADBEbef['Cumulative Return Before Crash'] = (1 + ADBEbef['avgreturnbefore']).cumprod()
#period of crash
ADBEdur = web.DataReader('ADBE', 'yahoo', crashstart, crashend)
ADBEdur['avgreturnduring'] = ADBEdur['Close'].pct_change(1)
ADBEdur['Cumulative Return During Crash'] = (1 + ADBEdur['avgreturnduring']).cumprod()
#period after crash
ADBEaft = web.DataReader('ADBE', 'yahoo', crashend, end)
ADBEaft['avgreturnafter'] = ADBEaft['Close'].pct_change(1)
ADBEaft['Cumulative Return After Crash'] = (1 + ADBEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AMD = web.DataReader('AMD', 'yahoo', start, end)
AMD['returns'] = AMD['Close'].pct_change(1)
AMD['Cumulative Return'] = (1 + AMD['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AMDmean = AMD['returns'].mean()
AMDvar = AMD['returns'].var()
AMDkurt = AMD['returns'].kurt()
AMDskew = AMD['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AMDbef = web.DataReader('AMD', 'yahoo', start, crashstart)
AMDbef['avgreturnbefore'] = AMDbef['Close'].pct_change(1)
AMDbef['Cumulative Return Before Crash'] = (1 + AMDbef['avgreturnbefore']).cumprod()
#period of crash
AMDdur = web.DataReader('AMD', 'yahoo', crashstart, crashend)
AMDdur['avgreturnduring'] = AMDdur['Close'].pct_change(1)
AMDdur['Cumulative Return During Crash'] = (1 + AMDdur['avgreturnduring']).cumprod()
#period after crash
AMDaft = web.DataReader('AMD', 'yahoo', crashend, end)
AMDaft['avgreturnafter'] = AMDaft['Close'].pct_change(1)
AMDaft['Cumulative Return After Crash'] = (1 + AMDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AKAM = web.DataReader('AKAM', 'yahoo', start, end)
AKAM['returns'] = AKAM['Close'].pct_change(1)
AKAM['Cumulative Return'] = (1 + AKAM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AKAMmean = AKAM['returns'].mean()
AKAMvar = AKAM['returns'].var()
AKAMkurt = AKAM['returns'].kurt()
AKAMskew = AKAM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AKAMbef = web.DataReader('AKAM', 'yahoo', start, crashstart)
AKAMbef['avgreturnbefore'] = AKAMbef['Close'].pct_change(1)
AKAMbef['Cumulative Return Before Crash'] = (1 + AKAMbef['avgreturnbefore']).cumprod()
#period of crash
AKAMdur = web.DataReader('AKAM', 'yahoo', crashstart, crashend)
AKAMdur['avgreturnduring'] = AKAMdur['Close'].pct_change(1)
AKAMdur['Cumulative Return During Crash'] = (1 + AKAMdur['avgreturnduring']).cumprod()
#period after crash
AKAMaft = web.DataReader('AKAM', 'yahoo', crashend, end)
AKAMaft['avgreturnafter'] = AKAMaft['Close'].pct_change(1)
AKAMaft['Cumulative Return After Crash'] = (1 + AKAMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ADS = web.DataReader('ADS', 'yahoo', start, end)
ADS['returns'] = ADS['Close'].pct_change(1)
ADS['Cumulative Return'] = (1 + ADS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ADSmean = ADS['returns'].mean()
ADSvar = ADS['returns'].var()
ADSkurt = ADS['returns'].kurt()
ADSskew = ADS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ADSbef = web.DataReader('ADS', 'yahoo', start, crashstart)
ADSbef['avgreturnbefore'] = ADSbef['Close'].pct_change(1)
ADSbef['Cumulative Return Before Crash'] = (1 + ADSbef['avgreturnbefore']).cumprod()
#period of crash
ADSdur = web.DataReader('ADS', 'yahoo', crashstart, crashend)
ADSdur['avgreturnduring'] = ADSdur['Close'].pct_change(1)
ADSdur['Cumulative Return During Crash'] = (1 + ADSdur['avgreturnduring']).cumprod()
#period after crash
ADSaft = web.DataReader('ADS', 'yahoo', crashend, end)
ADSaft['avgreturnafter'] = ADSaft['Close'].pct_change(1)
ADSaft['Cumulative Return After Crash'] = (1 + ADSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
APH = web.DataReader('APH', 'yahoo', start, end)
APH['returns'] = APH['Close'].pct_change(1)
APH['Cumulative Return'] = (1 + APH['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
APHmean = APH['returns'].mean()
APHvar = APH['returns'].var()
APHkurt = APH['returns'].kurt()
APHskew = APH['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
APHbef = web.DataReader('APH', 'yahoo', start, crashstart)
APHbef['avgreturnbefore'] = APHbef['Close'].pct_change(1)
APHbef['Cumulative Return Before Crash'] = (1 + APHbef['avgreturnbefore']).cumprod()
#period of crash
APHdur = web.DataReader('APH', 'yahoo', crashstart, crashend)
APHdur['avgreturnduring'] = APHdur['Close'].pct_change(1)
APHdur['Cumulative Return During Crash'] = (1 + APHdur['avgreturnduring']).cumprod()
#period after crash
APHaft = web.DataReader('APH', 'yahoo', crashend, end)
APHaft['avgreturnafter'] = APHaft['Close'].pct_change(1)
APHaft['Cumulative Return After Crash'] = (1 + APHaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ADI = web.DataReader('ADI', 'yahoo', start, end)
ADI['returns'] = ADI['Close'].pct_change(1)
ADI['Cumulative Return'] = (1 + ADI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ADImean = ADI['returns'].mean()
ADIvar = ADI['returns'].var()
ADIkurt = ADI['returns'].kurt()
ADIskew = ADI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ADIbef = web.DataReader('ADI', 'yahoo', start, crashstart)
ADIbef['avgreturnbefore'] = ADIbef['Close'].pct_change(1)
ADIbef['Cumulative Return Before Crash'] = (1 + ADIbef['avgreturnbefore']).cumprod()
#period of crash
ADIdur = web.DataReader('ADI', 'yahoo', crashstart, crashend)
ADIdur['avgreturnduring'] = ADIdur['Close'].pct_change(1)
ADIdur['Cumulative Return During Crash'] = (1 + ADIdur['avgreturnduring']).cumprod()
#period after crash
ADIaft = web.DataReader('ADI', 'yahoo', crashend, end)
ADIaft['avgreturnafter'] = ADIaft['Close'].pct_change(1)
ADIaft['Cumulative Return After Crash'] = (1 + ADIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ANSS = web.DataReader('ANSS', 'yahoo', start, end)
ANSS['returns'] = ANSS['Close'].pct_change(1)
ANSS['Cumulative Return'] = (1 + ANSS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ANSSmean = ANSS['returns'].mean()
ANSSvar = ANSS['returns'].var()
ANSSkurt = ANSS['returns'].kurt()
ANSSskew = ANSS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ANSSbef = web.DataReader('ANSS', 'yahoo', start, crashstart)
ANSSbef['avgreturnbefore'] = ANSSbef['Close'].pct_change(1)
ANSSbef['Cumulative Return Before Crash'] = (1 + ANSSbef['avgreturnbefore']).cumprod()
#period of crash
ANSSdur = web.DataReader('ANSS', 'yahoo', crashstart, crashend)
ANSSdur['avgreturnduring'] = ANSSdur['Close'].pct_change(1)
ANSSdur['Cumulative Return During Crash'] = (1 + ANSSdur['avgreturnduring']).cumprod()
#period after crash
ANSSaft = web.DataReader('ANSS', 'yahoo', crashend, end)
ANSSaft['avgreturnafter'] = ANSSaft['Close'].pct_change(1)
ANSSaft['Cumulative Return After Crash'] = (1 + ANSSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AAPL = web.DataReader('AAPL', 'yahoo', start, end)
AAPL['returns'] = AAPL['Close'].pct_change(1)
AAPL['Cumulative Return'] = (1 + AAPL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AAPLmean = AAPL['returns'].mean()
AAPLvar = AAPL['returns'].var()
AAPLkurt = AAPL['returns'].kurt()
AAPLskew = AAPL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AAPLbef = web.DataReader('AAPL', 'yahoo', start, crashstart)
AAPLbef['avgreturnbefore'] = AAPLbef['Close'].pct_change(1)
AAPLbef['Cumulative Return Before Crash'] = (1 + AAPLbef['avgreturnbefore']).cumprod()
#period of crash
AAPLdur = web.DataReader('AAPL', 'yahoo', crashstart, crashend)
AAPLdur['avgreturnduring'] = AAPLdur['Close'].pct_change(1)
AAPLdur['Cumulative Return During Crash'] = (1 + AAPLdur['avgreturnduring']).cumprod()
#period after crash
AAPLaft = web.DataReader('AAPL', 'yahoo', crashend, end)
AAPLaft['avgreturnafter'] = AAPLaft['Close'].pct_change(1)
AAPLaft['Cumulative Return After Crash'] = (1 + AAPLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AMAT = web.DataReader('AMAT', 'yahoo', start, end)
AMAT['returns'] = AMAT['Close'].pct_change(1)
AMAT['Cumulative Return'] = (1 + AMAT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AMATmean = AMAT['returns'].mean()
AMATvar = AMAT['returns'].var()
AMATkurt = AMAT['returns'].kurt()
AMATskew = AMAT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AMATbef = web.DataReader('AMAT', 'yahoo', start, crashstart)
AMATbef['avgreturnbefore'] = AMATbef['Close'].pct_change(1)
AMATbef['Cumulative Return Before Crash'] = (1 + AMATbef['avgreturnbefore']).cumprod()
#period of crash
AMATdur = web.DataReader('AMAT', 'yahoo', crashstart, crashend)
AMATdur['avgreturnduring'] = AMATdur['Close'].pct_change(1)
AMATdur['Cumulative Return During Crash'] = (1 + AMATdur['avgreturnduring']).cumprod()
#period after crash
AMATaft = web.DataReader('AMAT', 'yahoo', crashend, end)
AMATaft['avgreturnafter'] = AMATaft['Close'].pct_change(1)
AMATaft['Cumulative Return After Crash'] = (1 + AMATaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ANET = web.DataReader('ANET', 'yahoo', start, end)
ANET['returns'] = ANET['Close'].pct_change(1)
ANET['Cumulative Return'] = (1 + ANET['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ANETmean = ANET['returns'].mean()
ANETvar = ANET['returns'].var()
ANETkurt = ANET['returns'].kurt()
ANETskew = ANET['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ANETbef = web.DataReader('ANET', 'yahoo', start, crashstart)
ANETbef['avgreturnbefore'] = ANETbef['Close'].pct_change(1)
ANETbef['Cumulative Return Before Crash'] = (1 + ANETbef['avgreturnbefore']).cumprod()
#period of crash
ANETdur = web.DataReader('ANET', 'yahoo', crashstart, crashend)
ANETdur['avgreturnduring'] = ANETdur['Close'].pct_change(1)
ANETdur['Cumulative Return During Crash'] = (1 + ANETdur['avgreturnduring']).cumprod()
#period after crash
ANETaft = web.DataReader('ANET', 'yahoo', crashend, end)
ANETaft['avgreturnafter'] = ANETaft['Close'].pct_change(1)
ANETaft['Cumulative Return After Crash'] = (1 + ANETaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ADSK = web.DataReader('ADSK', 'yahoo', start, end)
ADSK['returns'] = ADSK['Close'].pct_change(1)
ADSK['Cumulative Return'] = (1 + ADSK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ADSKmean = ADSK['returns'].mean()
ADSKvar = ADSK['returns'].var()
ADSKkurt = ADSK['returns'].kurt()
ADSKskew = ADSK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ADSKbef = web.DataReader('ADSK', 'yahoo', start, crashstart)
ADSKbef['avgreturnbefore'] = ADSKbef['Close'].pct_change(1)
ADSKbef['Cumulative Return Before Crash'] = (1 + ADSKbef['avgreturnbefore']).cumprod()
#period of crash
ADSKdur = web.DataReader('ADSK', 'yahoo', crashstart, crashend)
ADSKdur['avgreturnduring'] = ADSKdur['Close'].pct_change(1)
ADSKdur['Cumulative Return During Crash'] = (1 + ADSKdur['avgreturnduring']).cumprod()
#period after crash
ADSKaft = web.DataReader('ADSK', 'yahoo', crashend, end)
ADSKaft['avgreturnafter'] = ADSKaft['Close'].pct_change(1)
ADSKaft['Cumulative Return After Crash'] = (1 + ADSKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ADP = web.DataReader('ADP', 'yahoo', start, end)
ADP['returns'] = ADP['Close'].pct_change(1)
ADP['Cumulative Return'] = (1 + ADP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ADPmean = ADP['returns'].mean()
ADPvar = ADP['returns'].var()
ADPkurt = ADP['returns'].kurt()
ADPskew = ADP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ADPbef = web.DataReader('ADP', 'yahoo', start, crashstart)
ADPbef['avgreturnbefore'] = ADPbef['Close'].pct_change(1)
ADPbef['Cumulative Return Before Crash'] = (1 + ADPbef['avgreturnbefore']).cumprod()
#period of crash
ADPdur = web.DataReader('ADP', 'yahoo', crashstart, crashend)
ADPdur['avgreturnduring'] = ADPdur['Close'].pct_change(1)
ADPdur['Cumulative Return During Crash'] = (1 + ADPdur['avgreturnduring']).cumprod()
#period after crash
ADPaft = web.DataReader('ADP', 'yahoo', crashend, end)
ADPaft['avgreturnafter'] = ADPaft['Close'].pct_change(1)
ADPaft['Cumulative Return After Crash'] = (1 + ADPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AVGO = web.DataReader('AVGO', 'yahoo', start, end)
AVGO['returns'] = AVGO['Close'].pct_change(1)
AVGO['Cumulative Return'] = (1 + AVGO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AVGOmean = AVGO['returns'].mean()
AVGOvar = AVGO['returns'].var()
AVGOkurt = AVGO['returns'].kurt()
AVGOskew = AVGO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AVGObef = web.DataReader('AVGO', 'yahoo', start, crashstart)
AVGObef['avgreturnbefore'] = AVGObef['Close'].pct_change(1)
AVGObef['Cumulative Return Before Crash'] = (1 + AVGObef['avgreturnbefore']).cumprod()
#period of crash
AVGOdur = web.DataReader('AVGO', 'yahoo', crashstart, crashend)
AVGOdur['avgreturnduring'] = AVGOdur['Close'].pct_change(1)
AVGOdur['Cumulative Return During Crash'] = (1 + AVGOdur['avgreturnduring']).cumprod()
#period after crash
AVGOaft = web.DataReader('AVGO', 'yahoo', crashend, end)
AVGOaft['avgreturnafter'] = AVGOaft['Close'].pct_change(1)
AVGOaft['Cumulative Return After Crash'] = (1 + AVGOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BR = web.DataReader('BR', 'yahoo', start, end)
BR['returns'] = BR['Close'].pct_change(1)
BR['Cumulative Return'] = (1 + BR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BRmean = BR['returns'].mean()
BRvar = BR['returns'].var()
BRkurt = BR['returns'].kurt()
BRskew = BR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BRbef = web.DataReader('BR', 'yahoo', start, crashstart)
BRbef['avgreturnbefore'] = BRbef['Close'].pct_change(1)
BRbef['Cumulative Return Before Crash'] = (1 + BRbef['avgreturnbefore']).cumprod()
#period of crash
BRdur = web.DataReader('BR', 'yahoo', crashstart, crashend)
BRdur['avgreturnduring'] = BRdur['Close'].pct_change(1)
BRdur['Cumulative Return During Crash'] = (1 + BRdur['avgreturnduring']).cumprod()
#period after crash
BRaft = web.DataReader('BR', 'yahoo', crashend, end)
BRaft['avgreturnafter'] = BRaft['Close'].pct_change(1)
BRaft['Cumulative Return After Crash'] = (1 + BRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CDNS = web.DataReader('CDNS', 'yahoo', start, end)
CDNS['returns'] = CDNS['Close'].pct_change(1)
CDNS['Cumulative Return'] = (1 + CDNS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CDNSmean = CDNS['returns'].mean()
CDNSvar = CDNS['returns'].var()
CDNSkurt = CDNS['returns'].kurt()
CDNSskew = CDNS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CDNSbef = web.DataReader('CDNS', 'yahoo', start, crashstart)
CDNSbef['avgreturnbefore'] = CDNSbef['Close'].pct_change(1)
CDNSbef['Cumulative Return Before Crash'] = (1 + CDNSbef['avgreturnbefore']).cumprod()
#period of crash
CDNSdur = web.DataReader('CDNS', 'yahoo', crashstart, crashend)
CDNSdur['avgreturnduring'] = CDNSdur['Close'].pct_change(1)
CDNSdur['Cumulative Return During Crash'] = (1 + CDNSdur['avgreturnduring']).cumprod()
#period after crash
CDNSaft = web.DataReader('CDNS', 'yahoo', crashend, end)
CDNSaft['avgreturnafter'] = CDNSaft['Close'].pct_change(1)
CDNSaft['Cumulative Return After Crash'] = (1 + CDNSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CDW = web.DataReader('CDW', 'yahoo', start, end)
CDW['returns'] = CDW['Close'].pct_change(1)
CDW['Cumulative Return'] = (1 + CDW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CDWmean = CDW['returns'].mean()
CDWvar = CDW['returns'].var()
CDWkurt = CDW['returns'].kurt()
CDWskew = CDW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CDWbef = web.DataReader('CDW', 'yahoo', start, crashstart)
CDWbef['avgreturnbefore'] = CDWbef['Close'].pct_change(1)
CDWbef['Cumulative Return Before Crash'] = (1 + CDWbef['avgreturnbefore']).cumprod()
#period of crash
CDWdur = web.DataReader('CDW', 'yahoo', crashstart, crashend)
CDWdur['avgreturnduring'] = CDWdur['Close'].pct_change(1)
CDWdur['Cumulative Return During Crash'] = (1 + CDWdur['avgreturnduring']).cumprod()
#period after crash
CDWaft = web.DataReader('CDW', 'yahoo', crashend, end)
CDWaft['avgreturnafter'] = CDWaft['Close'].pct_change(1)
CDWaft['Cumulative Return After Crash'] = (1 + CDWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CSCO = web.DataReader('CSCO', 'yahoo', start, end)
CSCO['returns'] = CSCO['Close'].pct_change(1)
CSCO['Cumulative Return'] = (1 + CSCO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CSCOmean = CSCO['returns'].mean()
CSCOvar = CSCO['returns'].var()
CSCOkurt = CSCO['returns'].kurt()
CSCOskew = CSCO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CSCObef = web.DataReader('CSCO', 'yahoo', start, crashstart)
CSCObef['avgreturnbefore'] = CSCObef['Close'].pct_change(1)
CSCObef['Cumulative Return Before Crash'] = (1 + CSCObef['avgreturnbefore']).cumprod()
#period of crash
CSCOdur = web.DataReader('CSCO', 'yahoo', crashstart, crashend)
CSCOdur['avgreturnduring'] = CSCOdur['Close'].pct_change(1)
CSCOdur['Cumulative Return During Crash'] = (1 + CSCOdur['avgreturnduring']).cumprod()
#period after crash
CSCOaft = web.DataReader('CSCO', 'yahoo', crashend, end)
CSCOaft['avgreturnafter'] = CSCOaft['Close'].pct_change(1)
CSCOaft['Cumulative Return After Crash'] = (1 + CSCOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CTXS = web.DataReader('CTXS', 'yahoo', start, end)
CTXS['returns'] = CTXS['Close'].pct_change(1)
CTXS['Cumulative Return'] = (1 + CTXS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CTXSmean = CTXS['returns'].mean()
CTXSvar = CTXS['returns'].var()
CTXSkurt = CTXS['returns'].kurt()
CTXSskew = CTXS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CTXSbef = web.DataReader('CTXS', 'yahoo', start, crashstart)
CTXSbef['avgreturnbefore'] = CTXSbef['Close'].pct_change(1)
CTXSbef['Cumulative Return Before Crash'] = (1 + CTXSbef['avgreturnbefore']).cumprod()
#period of crash
CTXSdur = web.DataReader('CTXS', 'yahoo', crashstart, crashend)
CTXSdur['avgreturnduring'] = CTXSdur['Close'].pct_change(1)
CTXSdur['Cumulative Return During Crash'] = (1 + CTXSdur['avgreturnduring']).cumprod()
#period after crash
CTXSaft = web.DataReader('CTXS', 'yahoo', crashend, end)
CTXSaft['avgreturnafter'] = CTXSaft['Close'].pct_change(1)
CTXSaft['Cumulative Return After Crash'] = (1 + CTXSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CTSH = web.DataReader('CTSH', 'yahoo', start, end)
CTSH['returns'] = CTSH['Close'].pct_change(1)
CTSH['Cumulative Return'] = (1 + CTSH['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CTSHmean = CTSH['returns'].mean()
CTSHvar = CTSH['returns'].var()
CTSHkurt = CTSH['returns'].kurt()
CTSHskew = CTSH['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CTSHbef = web.DataReader('CTSH', 'yahoo', start, crashstart)
CTSHbef['avgreturnbefore'] = CTSHbef['Close'].pct_change(1)
CTSHbef['Cumulative Return Before Crash'] = (1 + CTSHbef['avgreturnbefore']).cumprod()
#period of crash
CTSHdur = web.DataReader('CTSH', 'yahoo', crashstart, crashend)
CTSHdur['avgreturnduring'] = CTSHdur['Close'].pct_change(1)
CTSHdur['Cumulative Return During Crash'] = (1 + CTSHdur['avgreturnduring']).cumprod()
#period after crash
CTSHaft = web.DataReader('CTSH', 'yahoo', crashend, end)
CTSHaft['avgreturnafter'] = CTSHaft['Close'].pct_change(1)
CTSHaft['Cumulative Return After Crash'] = (1 + CTSHaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GLW = web.DataReader('GLW', 'yahoo', start, end)
GLW['returns'] = GLW['Close'].pct_change(1)
GLW['Cumulative Return'] = (1 + GLW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GLWmean = GLW['returns'].mean()
GLWvar = GLW['returns'].var()
GLWkurt = GLW['returns'].kurt()
GLWskew = GLW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GLWbef = web.DataReader('GLW', 'yahoo', start, crashstart)
GLWbef['avgreturnbefore'] = GLWbef['Close'].pct_change(1)
GLWbef['Cumulative Return Before Crash'] = (1 + GLWbef['avgreturnbefore']).cumprod()
#period of crash
GLWdur = web.DataReader('GLW', 'yahoo', crashstart, crashend)
GLWdur['avgreturnduring'] = GLWdur['Close'].pct_change(1)
GLWdur['Cumulative Return During Crash'] = (1 + GLWdur['avgreturnduring']).cumprod()
#period after crash
GLWaft = web.DataReader('GLW', 'yahoo', crashend, end)
GLWaft['avgreturnafter'] = GLWaft['Close'].pct_change(1)
GLWaft['Cumulative Return After Crash'] = (1 + GLWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DXC = web.DataReader('DXC', 'yahoo', start, end)
DXC['returns'] = DXC['Close'].pct_change(1)
DXC['Cumulative Return'] = (1 + DXC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DXCmean = DXC['returns'].mean()
DXCvar = DXC['returns'].var()
DXCkurt = DXC['returns'].kurt()
DXCskew = DXC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DXCbef = web.DataReader('DXC', 'yahoo', start, crashstart)
DXCbef['avgreturnbefore'] = DXCbef['Close'].pct_change(1)
DXCbef['Cumulative Return Before Crash'] = (1 + DXCbef['avgreturnbefore']).cumprod()
#period of crash
DXCdur = web.DataReader('DXC', 'yahoo', crashstart, crashend)
DXCdur['avgreturnduring'] = DXCdur['Close'].pct_change(1)
DXCdur['Cumulative Return During Crash'] = (1 + DXCdur['avgreturnduring']).cumprod()
#period after crash
DXCaft = web.DataReader('DXC', 'yahoo', crashend, end)
DXCaft['avgreturnafter'] = DXCaft['Close'].pct_change(1)
DXCaft['Cumulative Return After Crash'] = (1 + DXCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FFIV = web.DataReader('FFIV', 'yahoo', start, end)
FFIV['returns'] = FFIV['Close'].pct_change(1)
FFIV['Cumulative Return'] = (1 + FFIV['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FFIVmean = FFIV['returns'].mean()
FFIVvar = FFIV['returns'].var()
FFIVkurt = FFIV['returns'].kurt()
FFIVskew = FFIV['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FFIVbef = web.DataReader('FFIV', 'yahoo', start, crashstart)
FFIVbef['avgreturnbefore'] = FFIVbef['Close'].pct_change(1)
FFIVbef['Cumulative Return Before Crash'] = (1 + FFIVbef['avgreturnbefore']).cumprod()
#period of crash
FFIVdur = web.DataReader('FFIV', 'yahoo', crashstart, crashend)
FFIVdur['avgreturnduring'] = FFIVdur['Close'].pct_change(1)
FFIVdur['Cumulative Return During Crash'] = (1 + FFIVdur['avgreturnduring']).cumprod()
#period after crash
FFIVaft = web.DataReader('FFIV', 'yahoo', crashend, end)
FFIVaft['avgreturnafter'] = FFIVaft['Close'].pct_change(1)
FFIVaft['Cumulative Return After Crash'] = (1 + FFIVaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FIS = web.DataReader('FIS', 'yahoo', start, end)
FIS['returns'] = FIS['Close'].pct_change(1)
FIS['Cumulative Return'] = (1 + FIS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FISmean = FIS['returns'].mean()
FISvar = FIS['returns'].var()
FISkurt = FIS['returns'].kurt()
FISskew = FIS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FISbef = web.DataReader('FIS', 'yahoo', start, crashstart)
FISbef['avgreturnbefore'] = FISbef['Close'].pct_change(1)
FISbef['Cumulative Return Before Crash'] = (1 + FISbef['avgreturnbefore']).cumprod()
#period of crash
FISdur = web.DataReader('FIS', 'yahoo', crashstart, crashend)
FISdur['avgreturnduring'] = FISdur['Close'].pct_change(1)
FISdur['Cumulative Return During Crash'] = (1 + FISdur['avgreturnduring']).cumprod()
#period after crash
FISaft = web.DataReader('FIS', 'yahoo', crashend, end)
FISaft['avgreturnafter'] = FISaft['Close'].pct_change(1)
FISaft['Cumulative Return After Crash'] = (1 + FISaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FISV = web.DataReader('FISV', 'yahoo', start, end)
FISV['returns'] = FISV['Close'].pct_change(1)
FISV['Cumulative Return'] = (1 + FISV['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FISVmean = FISV['returns'].mean()
FISVvar = FISV['returns'].var()
FISVkurt = FISV['returns'].kurt()
FISVskew = FISV['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FISVbef = web.DataReader('FISV', 'yahoo', start, crashstart)
FISVbef['avgreturnbefore'] = FISVbef['Close'].pct_change(1)
FISVbef['Cumulative Return Before Crash'] = (1 + FISVbef['avgreturnbefore']).cumprod()
#period of crash
FISVdur = web.DataReader('FISV', 'yahoo', crashstart, crashend)
FISVdur['avgreturnduring'] = FISVdur['Close'].pct_change(1)
FISVdur['Cumulative Return During Crash'] = (1 + FISVdur['avgreturnduring']).cumprod()
#period after crash
FISVaft = web.DataReader('FISV', 'yahoo', crashend, end)
FISVaft['avgreturnafter'] = FISVaft['Close'].pct_change(1)
FISVaft['Cumulative Return After Crash'] = (1 + FISVaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FLT = web.DataReader('FLT', 'yahoo', start, end)
FLT['returns'] = FLT['Close'].pct_change(1)
FLT['Cumulative Return'] = (1 + FLT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FLTmean = FLT['returns'].mean()
FLTvar = FLT['returns'].var()
FLTkurt = FLT['returns'].kurt()
FLTskew = FLT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FLTbef = web.DataReader('FLT', 'yahoo', start, crashstart)
FLTbef['avgreturnbefore'] = FLTbef['Close'].pct_change(1)
FLTbef['Cumulative Return Before Crash'] = (1 + FLTbef['avgreturnbefore']).cumprod()
#period of crash
FLTdur = web.DataReader('FLT', 'yahoo', crashstart, crashend)
FLTdur['avgreturnduring'] = FLTdur['Close'].pct_change(1)
FLTdur['Cumulative Return During Crash'] = (1 + FLTdur['avgreturnduring']).cumprod()
#period after crash
FLTaft = web.DataReader('FLT', 'yahoo', crashend, end)
FLTaft['avgreturnafter'] = FLTaft['Close'].pct_change(1)
FLTaft['Cumulative Return After Crash'] = (1 + FLTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FLIR = web.DataReader('FLIR', 'yahoo', start, end)
FLIR['returns'] = FLIR['Close'].pct_change(1)
FLIR['Cumulative Return'] = (1 + FLIR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FLIRmean = FLIR['returns'].mean()
FLIRvar = FLIR['returns'].var()
FLIRkurt = FLIR['returns'].kurt()
FLIRskew = FLIR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FLIRbef = web.DataReader('FLIR', 'yahoo', start, crashstart)
FLIRbef['avgreturnbefore'] = FLIRbef['Close'].pct_change(1)
FLIRbef['Cumulative Return Before Crash'] = (1 + FLIRbef['avgreturnbefore']).cumprod()
#period of crash
FLIRdur = web.DataReader('FLIR', 'yahoo', crashstart, crashend)
FLIRdur['avgreturnduring'] = FLIRdur['Close'].pct_change(1)
FLIRdur['Cumulative Return During Crash'] = (1 + FLIRdur['avgreturnduring']).cumprod()
#period after crash
FLIRaft = web.DataReader('FLIR', 'yahoo', crashend, end)
FLIRaft['avgreturnafter'] = FLIRaft['Close'].pct_change(1)
FLIRaft['Cumulative Return After Crash'] = (1 + FLIRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FTNT = web.DataReader('FTNT', 'yahoo', start, end)
FTNT['returns'] = FTNT['Close'].pct_change(1)
FTNT['Cumulative Return'] = (1 + FTNT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FTNTmean = FTNT['returns'].mean()
FTNTvar = FTNT['returns'].var()
FTNTkurt = FTNT['returns'].kurt()
FTNTskew = FTNT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FTNTbef = web.DataReader('FTNT', 'yahoo', start, crashstart)
FTNTbef['avgreturnbefore'] = FTNTbef['Close'].pct_change(1)
FTNTbef['Cumulative Return Before Crash'] = (1 + FTNTbef['avgreturnbefore']).cumprod()
#period of crash
FTNTdur = web.DataReader('FTNT', 'yahoo', crashstart, crashend)
FTNTdur['avgreturnduring'] = FTNTdur['Close'].pct_change(1)
FTNTdur['Cumulative Return During Crash'] = (1 + FTNTdur['avgreturnduring']).cumprod()
#period after crash
FTNTaft = web.DataReader('FTNT', 'yahoo', crashend, end)
FTNTaft['avgreturnafter'] = FTNTaft['Close'].pct_change(1)
FTNTaft['Cumulative Return After Crash'] = (1 + FTNTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
IT = web.DataReader('IT', 'yahoo', start, end)
IT['returns'] = IT['Close'].pct_change(1)
IT['Cumulative Return'] = (1 + IT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ITmean = IT['returns'].mean()
ITvar = IT['returns'].var()
ITkurt = IT['returns'].kurt()
ITskew = IT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ITbef = web.DataReader('IT', 'yahoo', start, crashstart)
ITbef['avgreturnbefore'] = ITbef['Close'].pct_change(1)
ITbef['Cumulative Return Before Crash'] = (1 + ITbef['avgreturnbefore']).cumprod()
#period of crash
ITdur = web.DataReader('IT', 'yahoo', crashstart, crashend)
ITdur['avgreturnduring'] = ITdur['Close'].pct_change(1)
ITdur['Cumulative Return During Crash'] = (1 + ITdur['avgreturnduring']).cumprod()
#period after crash
ITaft = web.DataReader('IT', 'yahoo', crashend, end)
ITaft['avgreturnafter'] = ITaft['Close'].pct_change(1)
ITaft['Cumulative Return After Crash'] = (1 + ITaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GPN = web.DataReader('GPN', 'yahoo', start, end)
GPN['returns'] = GPN['Close'].pct_change(1)
GPN['Cumulative Return'] = (1 + GPN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GPNmean = GPN['returns'].mean()
GPNvar = GPN['returns'].var()
GPNkurt = GPN['returns'].kurt()
GPNskew = GPN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GPNbef = web.DataReader('GPN', 'yahoo', start, crashstart)
GPNbef['avgreturnbefore'] = GPNbef['Close'].pct_change(1)
GPNbef['Cumulative Return Before Crash'] = (1 + GPNbef['avgreturnbefore']).cumprod()
#period of crash
GPNdur = web.DataReader('GPN', 'yahoo', crashstart, crashend)
GPNdur['avgreturnduring'] = GPNdur['Close'].pct_change(1)
GPNdur['Cumulative Return During Crash'] = (1 + GPNdur['avgreturnduring']).cumprod()
#period after crash
GPNaft = web.DataReader('GPN', 'yahoo', crashend, end)
GPNaft['avgreturnafter'] = GPNaft['Close'].pct_change(1)
GPNaft['Cumulative Return After Crash'] = (1 + GPNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HPE = web.DataReader('HPE', 'yahoo', start, end)
HPE['returns'] = HPE['Close'].pct_change(1)
HPE['Cumulative Return'] = (1 + HPE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HPEmean = HPE['returns'].mean()
HPEvar = HPE['returns'].var()
HPEkurt = HPE['returns'].kurt()
HPEskew = HPE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HPEbef = web.DataReader('HPE', 'yahoo', start, crashstart)
HPEbef['avgreturnbefore'] = HPEbef['Close'].pct_change(1)
HPEbef['Cumulative Return Before Crash'] = (1 + HPEbef['avgreturnbefore']).cumprod()
#period of crash
HPEdur = web.DataReader('HPE', 'yahoo', crashstart, crashend)
HPEdur['avgreturnduring'] = HPEdur['Close'].pct_change(1)
HPEdur['Cumulative Return During Crash'] = (1 + HPEdur['avgreturnduring']).cumprod()
#period after crash
HPEaft = web.DataReader('HPE', 'yahoo', crashend, end)
HPEaft['avgreturnafter'] = HPEaft['Close'].pct_change(1)
HPEaft['Cumulative Return After Crash'] = (1 + HPEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HPQ = web.DataReader('HPQ', 'yahoo', start, end)
HPQ['returns'] = HPQ['Close'].pct_change(1)
HPQ['Cumulative Return'] = (1 + HPQ['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HPQmean = HPQ['returns'].mean()
HPQvar = HPQ['returns'].var()
HPQkurt = HPQ['returns'].kurt()
HPQskew = HPQ['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HPQbef = web.DataReader('HPQ', 'yahoo', start, crashstart)
HPQbef['avgreturnbefore'] = HPQbef['Close'].pct_change(1)
HPQbef['Cumulative Return Before Crash'] = (1 + HPQbef['avgreturnbefore']).cumprod()
#period of crash
HPQdur = web.DataReader('HPQ', 'yahoo', crashstart, crashend)
HPQdur['avgreturnduring'] = HPQdur['Close'].pct_change(1)
HPQdur['Cumulative Return During Crash'] = (1 + HPQdur['avgreturnduring']).cumprod()
#period after crash
HPQaft = web.DataReader('HPQ', 'yahoo', crashend, end)
HPQaft['avgreturnafter'] = HPQaft['Close'].pct_change(1)
HPQaft['Cumulative Return After Crash'] = (1 + HPQaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
INTC = web.DataReader('INTC', 'yahoo', start, end)
INTC['returns'] = INTC['Close'].pct_change(1)
INTC['Cumulative Return'] = (1 + INTC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
INTCmean = INTC['returns'].mean()
INTCvar = INTC['returns'].var()
INTCkurt = INTC['returns'].kurt()
INTCskew = INTC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
INTCbef = web.DataReader('INTC', 'yahoo', start, crashstart)
INTCbef['avgreturnbefore'] = INTCbef['Close'].pct_change(1)
INTCbef['Cumulative Return Before Crash'] = (1 + INTCbef['avgreturnbefore']).cumprod()
#period of crash
INTCdur = web.DataReader('INTC', 'yahoo', crashstart, crashend)
INTCdur['avgreturnduring'] = INTCdur['Close'].pct_change(1)
INTCdur['Cumulative Return During Crash'] = (1 + INTCdur['avgreturnduring']).cumprod()
#period after crash
INTCaft = web.DataReader('INTC', 'yahoo', crashend, end)
INTCaft['avgreturnafter'] = INTCaft['Close'].pct_change(1)
INTCaft['Cumulative Return After Crash'] = (1 + INTCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
IBM = web.DataReader('IBM', 'yahoo', start, end)
IBM['returns'] = IBM['Close'].pct_change(1)
IBM['Cumulative Return'] = (1 + IBM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
IBMmean = IBM['returns'].mean()
IBMvar = IBM['returns'].var()
IBMkurt = IBM['returns'].kurt()
IBMskew = IBM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
IBMbef = web.DataReader('IBM', 'yahoo', start, crashstart)
IBMbef['avgreturnbefore'] = IBMbef['Close'].pct_change(1)
IBMbef['Cumulative Return Before Crash'] = (1 + IBMbef['avgreturnbefore']).cumprod()
#period of crash
IBMdur = web.DataReader('IBM', 'yahoo', crashstart, crashend)
IBMdur['avgreturnduring'] = IBMdur['Close'].pct_change(1)
IBMdur['Cumulative Return During Crash'] = (1 + IBMdur['avgreturnduring']).cumprod()
#period after crash
IBMaft = web.DataReader('IBM', 'yahoo', crashend, end)
IBMaft['avgreturnafter'] = IBMaft['Close'].pct_change(1)
IBMaft['Cumulative Return After Crash'] = (1 + IBMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
INTU = web.DataReader('INTU', 'yahoo', start, end)
INTU['returns'] = INTU['Close'].pct_change(1)
INTU['Cumulative Return'] = (1 + INTU['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
INTUmean = INTU['returns'].mean()
INTUvar = INTU['returns'].var()
INTUkurt = INTU['returns'].kurt()
INTUskew = INTU['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
INTUbef = web.DataReader('INTU', 'yahoo', start, crashstart)
INTUbef['avgreturnbefore'] = INTUbef['Close'].pct_change(1)
INTUbef['Cumulative Return Before Crash'] = (1 + INTUbef['avgreturnbefore']).cumprod()
#period of crash
INTUdur = web.DataReader('INTU', 'yahoo', crashstart, crashend)
INTUdur['avgreturnduring'] = INTUdur['Close'].pct_change(1)
INTUdur['Cumulative Return During Crash'] = (1 + INTUdur['avgreturnduring']).cumprod()
#period after crash
INTUaft = web.DataReader('INTU', 'yahoo', crashend, end)
INTUaft['avgreturnafter'] = INTUaft['Close'].pct_change(1)
INTUaft['Cumulative Return After Crash'] = (1 + INTUaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
IPGP = web.DataReader('IPGP', 'yahoo', start, end)
IPGP['returns'] = IPGP['Close'].pct_change(1)
IPGP['Cumulative Return'] = (1 + IPGP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
IPGPmean = IPGP['returns'].mean()
IPGPvar = IPGP['returns'].var()
IPGPkurt = IPGP['returns'].kurt()
IPGPskew = IPGP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
IPGPbef = web.DataReader('IPGP', 'yahoo', start, crashstart)
IPGPbef['avgreturnbefore'] = IPGPbef['Close'].pct_change(1)
IPGPbef['Cumulative Return Before Crash'] = (1 + IPGPbef['avgreturnbefore']).cumprod()
#period of crash
IPGPdur = web.DataReader('IPGP', 'yahoo', crashstart, crashend)
IPGPdur['avgreturnduring'] = IPGPdur['Close'].pct_change(1)
IPGPdur['Cumulative Return During Crash'] = (1 + IPGPdur['avgreturnduring']).cumprod()
#period after crash
IPGPaft = web.DataReader('IPGP', 'yahoo', crashend, end)
IPGPaft['avgreturnafter'] = IPGPaft['Close'].pct_change(1)
IPGPaft['Cumulative Return After Crash'] = (1 + IPGPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
JKHY = web.DataReader('JKHY', 'yahoo', start, end)
JKHY['returns'] = JKHY['Close'].pct_change(1)
JKHY['Cumulative Return'] = (1 + JKHY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
JKHYmean = JKHY['returns'].mean()
JKHYvar = JKHY['returns'].var()
JKHYkurt = JKHY['returns'].kurt()
JKHYskew = JKHY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
JKHYbef = web.DataReader('JKHY', 'yahoo', start, crashstart)
JKHYbef['avgreturnbefore'] = JKHYbef['Close'].pct_change(1)
JKHYbef['Cumulative Return Before Crash'] = (1 + JKHYbef['avgreturnbefore']).cumprod()
#period of crash
JKHYdur = web.DataReader('JKHY', 'yahoo', crashstart, crashend)
JKHYdur['avgreturnduring'] = JKHYdur['Close'].pct_change(1)
JKHYdur['Cumulative Return During Crash'] = (1 + JKHYdur['avgreturnduring']).cumprod()
#period after crash
JKHYaft = web.DataReader('JKHY', 'yahoo', crashend, end)
JKHYaft['avgreturnafter'] = JKHYaft['Close'].pct_change(1)
JKHYaft['Cumulative Return After Crash'] = (1 + JKHYaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
JNPR = web.DataReader('JNPR', 'yahoo', start, end)
JNPR['returns'] = JNPR['Close'].pct_change(1)
JNPR['Cumulative Return'] = (1 + JNPR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
JNPRmean = JNPR['returns'].mean()
JNPRvar = JNPR['returns'].var()
JNPRkurt = JNPR['returns'].kurt()
JNPRskew = JNPR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
JNPRbef = web.DataReader('JNPR', 'yahoo', start, crashstart)
JNPRbef['avgreturnbefore'] = JNPRbef['Close'].pct_change(1)
JNPRbef['Cumulative Return Before Crash'] = (1 + JNPRbef['avgreturnbefore']).cumprod()
#period of crash
JNPRdur = web.DataReader('JNPR', 'yahoo', crashstart, crashend)
JNPRdur['avgreturnduring'] = JNPRdur['Close'].pct_change(1)
JNPRdur['Cumulative Return During Crash'] = (1 + JNPRdur['avgreturnduring']).cumprod()
#period after crash
JNPRaft = web.DataReader('JNPR', 'yahoo', crashend, end)
JNPRaft['avgreturnafter'] = JNPRaft['Close'].pct_change(1)
JNPRaft['Cumulative Return After Crash'] = (1 + JNPRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
KEYS = web.DataReader('KEYS', 'yahoo', start, end)
KEYS['returns'] = KEYS['Close'].pct_change(1)
KEYS['Cumulative Return'] = (1 + KEYS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
KEYSmean = KEYS['returns'].mean()
KEYSvar = KEYS['returns'].var()
KEYSkurt = KEYS['returns'].kurt()
KEYSskew = KEYS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
KEYSbef = web.DataReader('KEYS', 'yahoo', start, crashstart)
KEYSbef['avgreturnbefore'] = KEYSbef['Close'].pct_change(1)
KEYSbef['Cumulative Return Before Crash'] = (1 + KEYSbef['avgreturnbefore']).cumprod()
#period of crash
KEYSdur = web.DataReader('KEYS', 'yahoo', crashstart, crashend)
KEYSdur['avgreturnduring'] = KEYSdur['Close'].pct_change(1)
KEYSdur['Cumulative Return During Crash'] = (1 + KEYSdur['avgreturnduring']).cumprod()
#period after crash
KEYSaft = web.DataReader('KEYS', 'yahoo', crashend, end)
KEYSaft['avgreturnafter'] = KEYSaft['Close'].pct_change(1)
KEYSaft['Cumulative Return After Crash'] = (1 + KEYSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
KLAC = web.DataReader('KLAC', 'yahoo', start, end)
KLAC['returns'] = KLAC['Close'].pct_change(1)
KLAC['Cumulative Return'] = (1 + KLAC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
KLACmean = KLAC['returns'].mean()
KLACvar = KLAC['returns'].var()
KLACkurt = KLAC['returns'].kurt()
KLACskew = KLAC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
KLACbef = web.DataReader('KLAC', 'yahoo', start, crashstart)
KLACbef['avgreturnbefore'] = KLACbef['Close'].pct_change(1)
KLACbef['Cumulative Return Before Crash'] = (1 + KLACbef['avgreturnbefore']).cumprod()
#period of crash
KLACdur = web.DataReader('KLAC', 'yahoo', crashstart, crashend)
KLACdur['avgreturnduring'] = KLACdur['Close'].pct_change(1)
KLACdur['Cumulative Return During Crash'] = (1 + KLACdur['avgreturnduring']).cumprod()
#period after crash
KLACaft = web.DataReader('KLAC', 'yahoo', crashend, end)
KLACaft['avgreturnafter'] = KLACaft['Close'].pct_change(1)
KLACaft['Cumulative Return After Crash'] = (1 + KLACaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LRCX = web.DataReader('LRCX', 'yahoo', start, end)
LRCX['returns'] = LRCX['Close'].pct_change(1)
LRCX['Cumulative Return'] = (1 + LRCX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LRCXmean = LRCX['returns'].mean()
LRCXvar = LRCX['returns'].var()
LRCXkurt = LRCX['returns'].kurt()
LRCXskew = LRCX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LRCXbef = web.DataReader('LRCX', 'yahoo', start, crashstart)
LRCXbef['avgreturnbefore'] = LRCXbef['Close'].pct_change(1)
LRCXbef['Cumulative Return Before Crash'] = (1 + LRCXbef['avgreturnbefore']).cumprod()
#period of crash
LRCXdur = web.DataReader('LRCX', 'yahoo', crashstart, crashend)
LRCXdur['avgreturnduring'] = LRCXdur['Close'].pct_change(1)
LRCXdur['Cumulative Return During Crash'] = (1 + LRCXdur['avgreturnduring']).cumprod()
#period after crash
LRCXaft = web.DataReader('LRCX', 'yahoo', crashend, end)
LRCXaft['avgreturnafter'] = LRCXaft['Close'].pct_change(1)
LRCXaft['Cumulative Return After Crash'] = (1 + LRCXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LDOS = web.DataReader('LDOS', 'yahoo', start, end)
LDOS['returns'] = LDOS['Close'].pct_change(1)
LDOS['Cumulative Return'] = (1 + LDOS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LDOSmean = LDOS['returns'].mean()
LDOSvar = LDOS['returns'].var()
LDOSkurt = LDOS['returns'].kurt()
LDOSskew = LDOS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LDOSbef = web.DataReader('LDOS', 'yahoo', start, crashstart)
LDOSbef['avgreturnbefore'] = LDOSbef['Close'].pct_change(1)
LDOSbef['Cumulative Return Before Crash'] = (1 + LDOSbef['avgreturnbefore']).cumprod()
#period of crash
LDOSdur = web.DataReader('LDOS', 'yahoo', crashstart, crashend)
LDOSdur['avgreturnduring'] = LDOSdur['Close'].pct_change(1)
LDOSdur['Cumulative Return During Crash'] = (1 + LDOSdur['avgreturnduring']).cumprod()
#period after crash
LDOSaft = web.DataReader('LDOS', 'yahoo', crashend, end)
LDOSaft['avgreturnafter'] = LDOSaft['Close'].pct_change(1)
LDOSaft['Cumulative Return After Crash'] = (1 + LDOSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MA = web.DataReader('MA', 'yahoo', start, end)
MA['returns'] = MA['Close'].pct_change(1)
MA['Cumulative Return'] = (1 + MA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MAmean = MA['returns'].mean()
MAvar = MA['returns'].var()
MAkurt = MA['returns'].kurt()
MAskew = MA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MAbef = web.DataReader('MA', 'yahoo', start, crashstart)
MAbef['avgreturnbefore'] = MAbef['Close'].pct_change(1)
MAbef['Cumulative Return Before Crash'] = (1 + MAbef['avgreturnbefore']).cumprod()
#period of crash
MAdur = web.DataReader('MA', 'yahoo', crashstart, crashend)
MAdur['avgreturnduring'] = MAdur['Close'].pct_change(1)
MAdur['Cumulative Return During Crash'] = (1 + MAdur['avgreturnduring']).cumprod()
#period after crash
MAaft = web.DataReader('MA', 'yahoo', crashend, end)
MAaft['avgreturnafter'] = MAaft['Close'].pct_change(1)
MAaft['Cumulative Return After Crash'] = (1 + MAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MXIM = web.DataReader('MXIM', 'yahoo', start, end)
MXIM['returns'] = MXIM['Close'].pct_change(1)
MXIM['Cumulative Return'] = (1 + MXIM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MXIMmean = MXIM['returns'].mean()
MXIMvar = MXIM['returns'].var()
MXIMkurt = MXIM['returns'].kurt()
MXIMskew = MXIM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MXIMbef = web.DataReader('MXIM', 'yahoo', start, crashstart)
MXIMbef['avgreturnbefore'] = MXIMbef['Close'].pct_change(1)
MXIMbef['Cumulative Return Before Crash'] = (1 + MXIMbef['avgreturnbefore']).cumprod()
#period of crash
MXIMdur = web.DataReader('MXIM', 'yahoo', crashstart, crashend)
MXIMdur['avgreturnduring'] = MXIMdur['Close'].pct_change(1)
MXIMdur['Cumulative Return During Crash'] = (1 + MXIMdur['avgreturnduring']).cumprod()
#period after crash
MXIMaft = web.DataReader('MXIM', 'yahoo', crashend, end)
MXIMaft['avgreturnafter'] = MXIMaft['Close'].pct_change(1)
MXIMaft['Cumulative Return After Crash'] = (1 + MXIMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MCHP = web.DataReader('MCHP', 'yahoo', start, end)
MCHP['returns'] = MCHP['Close'].pct_change(1)
MCHP['Cumulative Return'] = (1 + MCHP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MCHPmean = MCHP['returns'].mean()
MCHPvar = MCHP['returns'].var()
MCHPkurt = MCHP['returns'].kurt()
MCHPskew = MCHP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MCHPbef = web.DataReader('MCHP', 'yahoo', start, crashstart)
MCHPbef['avgreturnbefore'] = MCHPbef['Close'].pct_change(1)
MCHPbef['Cumulative Return Before Crash'] = (1 + MCHPbef['avgreturnbefore']).cumprod()
#period of crash
MCHPdur = web.DataReader('MCHP', 'yahoo', crashstart, crashend)
MCHPdur['avgreturnduring'] = MCHPdur['Close'].pct_change(1)
MCHPdur['Cumulative Return During Crash'] = (1 + MCHPdur['avgreturnduring']).cumprod()
#period after crash
MCHPaft = web.DataReader('MCHP', 'yahoo', crashend, end)
MCHPaft['avgreturnafter'] = MCHPaft['Close'].pct_change(1)
MCHPaft['Cumulative Return After Crash'] = (1 + MCHPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MU = web.DataReader('MU', 'yahoo', start, end)
MU['returns'] = MU['Close'].pct_change(1)
MU['Cumulative Return'] = (1 + MU['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MUmean = MU['returns'].mean()
MUvar = MU['returns'].var()
MUkurt = MU['returns'].kurt()
MUskew = MU['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MUbef = web.DataReader('MU', 'yahoo', start, crashstart)
MUbef['avgreturnbefore'] = MUbef['Close'].pct_change(1)
MUbef['Cumulative Return Before Crash'] = (1 + MUbef['avgreturnbefore']).cumprod()
#period of crash
MUdur = web.DataReader('MU', 'yahoo', crashstart, crashend)
MUdur['avgreturnduring'] = MUdur['Close'].pct_change(1)
MUdur['Cumulative Return During Crash'] = (1 + MUdur['avgreturnduring']).cumprod()
#period after crash
MUaft = web.DataReader('MU', 'yahoo', crashend, end)
MUaft['avgreturnafter'] = MUaft['Close'].pct_change(1)
MUaft['Cumulative Return After Crash'] = (1 + MUaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MSFT = web.DataReader('MSFT', 'yahoo', start, end)
MSFT['returns'] = MSFT['Close'].pct_change(1)
MSFT['Cumulative Return'] = (1 + MSFT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MSFTmean = MSFT['returns'].mean()
MSFTvar = MSFT['returns'].var()
MSFTkurt = MSFT['returns'].kurt()
MSFTskew = MSFT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MSFTbef = web.DataReader('MSFT', 'yahoo', start, crashstart)
MSFTbef['avgreturnbefore'] = MSFTbef['Close'].pct_change(1)
MSFTbef['Cumulative Return Before Crash'] = (1 + MSFTbef['avgreturnbefore']).cumprod()
#period of crash
MSFTdur = web.DataReader('MSFT', 'yahoo', crashstart, crashend)
MSFTdur['avgreturnduring'] = MSFTdur['Close'].pct_change(1)
MSFTdur['Cumulative Return During Crash'] = (1 + MSFTdur['avgreturnduring']).cumprod()
#period after crash
MSFTaft = web.DataReader('MSFT', 'yahoo', crashend, end)
MSFTaft['avgreturnafter'] = MSFTaft['Close'].pct_change(1)
MSFTaft['Cumulative Return After Crash'] = (1 + MSFTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MSI = web.DataReader('MSI', 'yahoo', start, end)
MSI['returns'] = MSI['Close'].pct_change(1)
MSI['Cumulative Return'] = (1 + MSI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MSImean = MSI['returns'].mean()
MSIvar = MSI['returns'].var()
MSIkurt = MSI['returns'].kurt()
MSIskew = MSI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MSIbef = web.DataReader('MSI', 'yahoo', start, crashstart)
MSIbef['avgreturnbefore'] = MSIbef['Close'].pct_change(1)
MSIbef['Cumulative Return Before Crash'] = (1 + MSIbef['avgreturnbefore']).cumprod()
#period of crash
MSIdur = web.DataReader('MSI', 'yahoo', crashstart, crashend)
MSIdur['avgreturnduring'] = MSIdur['Close'].pct_change(1)
MSIdur['Cumulative Return During Crash'] = (1 + MSIdur['avgreturnduring']).cumprod()
#period after crash
MSIaft = web.DataReader('MSI', 'yahoo', crashend, end)
MSIaft['avgreturnafter'] = MSIaft['Close'].pct_change(1)
MSIaft['Cumulative Return After Crash'] = (1 + MSIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NTAP = web.DataReader('NTAP', 'yahoo', start, end)
NTAP['returns'] = NTAP['Close'].pct_change(1)
NTAP['Cumulative Return'] = (1 + NTAP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NTAPmean = NTAP['returns'].mean()
NTAPvar = NTAP['returns'].var()
NTAPkurt = NTAP['returns'].kurt()
NTAPskew = NTAP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NTAPbef = web.DataReader('NTAP', 'yahoo', start, crashstart)
NTAPbef['avgreturnbefore'] = NTAPbef['Close'].pct_change(1)
NTAPbef['Cumulative Return Before Crash'] = (1 + NTAPbef['avgreturnbefore']).cumprod()
#period of crash
NTAPdur = web.DataReader('NTAP', 'yahoo', crashstart, crashend)
NTAPdur['avgreturnduring'] = NTAPdur['Close'].pct_change(1)
NTAPdur['Cumulative Return During Crash'] = (1 + NTAPdur['avgreturnduring']).cumprod()
#period after crash
NTAPaft = web.DataReader('NTAP', 'yahoo', crashend, end)
NTAPaft['avgreturnafter'] = NTAPaft['Close'].pct_change(1)
NTAPaft['Cumulative Return After Crash'] = (1 + NTAPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NLOK = web.DataReader('NLOK', 'yahoo', start, end)
NLOK['returns'] = NLOK['Close'].pct_change(1)
NLOK['Cumulative Return'] = (1 + NLOK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NLOKmean = NLOK['returns'].mean()
NLOKvar = NLOK['returns'].var()
NLOKkurt = NLOK['returns'].kurt()
NLOKskew = NLOK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NLOKbef = web.DataReader('NLOK', 'yahoo', start, crashstart)
NLOKbef['avgreturnbefore'] = NLOKbef['Close'].pct_change(1)
NLOKbef['Cumulative Return Before Crash'] = (1 + NLOKbef['avgreturnbefore']).cumprod()
#period of crash
NLOKdur = web.DataReader('NLOK', 'yahoo', crashstart, crashend)
NLOKdur['avgreturnduring'] = NLOKdur['Close'].pct_change(1)
NLOKdur['Cumulative Return During Crash'] = (1 + NLOKdur['avgreturnduring']).cumprod()
#period after crash
NLOKaft = web.DataReader('NLOK', 'yahoo', crashend, end)
NLOKaft['avgreturnafter'] = NLOKaft['Close'].pct_change(1)
NLOKaft['Cumulative Return After Crash'] = (1 + NLOKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NVDA = web.DataReader('NVDA', 'yahoo', start, end)
NVDA['returns'] = NVDA['Close'].pct_change(1)
NVDA['Cumulative Return'] = (1 + NVDA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NVDAmean = NVDA['returns'].mean()
NVDAvar = NVDA['returns'].var()
NVDAkurt = NVDA['returns'].kurt()
NVDAskew = NVDA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NVDAbef = web.DataReader('NVDA', 'yahoo', start, crashstart)
NVDAbef['avgreturnbefore'] = NVDAbef['Close'].pct_change(1)
NVDAbef['Cumulative Return Before Crash'] = (1 + NVDAbef['avgreturnbefore']).cumprod()
#period of crash
NVDAdur = web.DataReader('NVDA', 'yahoo', crashstart, crashend)
NVDAdur['avgreturnduring'] = NVDAdur['Close'].pct_change(1)
NVDAdur['Cumulative Return During Crash'] = (1 + NVDAdur['avgreturnduring']).cumprod()
#period after crash
NVDAaft = web.DataReader('NVDA', 'yahoo', crashend, end)
NVDAaft['avgreturnafter'] = NVDAaft['Close'].pct_change(1)
NVDAaft['Cumulative Return After Crash'] = (1 + NVDAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ORCL = web.DataReader('ORCL', 'yahoo', start, end)
ORCL['returns'] = ORCL['Close'].pct_change(1)
ORCL['Cumulative Return'] = (1 + ORCL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ORCLmean = ORCL['returns'].mean()
ORCLvar = ORCL['returns'].var()
ORCLkurt = ORCL['returns'].kurt()
ORCLskew = ORCL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ORCLbef = web.DataReader('ORCL', 'yahoo', start, crashstart)
ORCLbef['avgreturnbefore'] = ORCLbef['Close'].pct_change(1)
ORCLbef['Cumulative Return Before Crash'] = (1 + ORCLbef['avgreturnbefore']).cumprod()
#period of crash
ORCLdur = web.DataReader('ORCL', 'yahoo', crashstart, crashend)
ORCLdur['avgreturnduring'] = ORCLdur['Close'].pct_change(1)
ORCLdur['Cumulative Return During Crash'] = (1 + ORCLdur['avgreturnduring']).cumprod()
#period after crash
ORCLaft = web.DataReader('ORCL', 'yahoo', crashend, end)
ORCLaft['avgreturnafter'] = ORCLaft['Close'].pct_change(1)
ORCLaft['Cumulative Return After Crash'] = (1 + ORCLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PAYX = web.DataReader('PAYX', 'yahoo', start, end)
PAYX['returns'] = PAYX['Close'].pct_change(1)
PAYX['Cumulative Return'] = (1 + PAYX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PAYXmean = PAYX['returns'].mean()
PAYXvar = PAYX['returns'].var()
PAYXkurt = PAYX['returns'].kurt()
PAYXskew = PAYX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PAYXbef = web.DataReader('PAYX', 'yahoo', start, crashstart)
PAYXbef['avgreturnbefore'] = PAYXbef['Close'].pct_change(1)
PAYXbef['Cumulative Return Before Crash'] = (1 + PAYXbef['avgreturnbefore']).cumprod()
#period of crash
PAYXdur = web.DataReader('PAYX', 'yahoo', crashstart, crashend)
PAYXdur['avgreturnduring'] = PAYXdur['Close'].pct_change(1)
PAYXdur['Cumulative Return During Crash'] = (1 + PAYXdur['avgreturnduring']).cumprod()
#period after crash
PAYXaft = web.DataReader('PAYX', 'yahoo', crashend, end)
PAYXaft['avgreturnafter'] = PAYXaft['Close'].pct_change(1)
PAYXaft['Cumulative Return After Crash'] = (1 + PAYXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PAYC = web.DataReader('PAYC', 'yahoo', start, end)
PAYC['returns'] = PAYC['Close'].pct_change(1)
PAYC['Cumulative Return'] = (1 + PAYC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PAYCmean = PAYC['returns'].mean()
PAYCvar = PAYC['returns'].var()
PAYCkurt = PAYC['returns'].kurt()
PAYCskew = PAYC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PAYCbef = web.DataReader('PAYC', 'yahoo', start, crashstart)
PAYCbef['avgreturnbefore'] = PAYCbef['Close'].pct_change(1)
PAYCbef['Cumulative Return Before Crash'] = (1 + PAYCbef['avgreturnbefore']).cumprod()
#period of crash
PAYCdur = web.DataReader('PAYC', 'yahoo', crashstart, crashend)
PAYCdur['avgreturnduring'] = PAYCdur['Close'].pct_change(1)
PAYCdur['Cumulative Return During Crash'] = (1 + PAYCdur['avgreturnduring']).cumprod()
#period after crash
PAYCaft = web.DataReader('PAYC', 'yahoo', crashend, end)
PAYCaft['avgreturnafter'] = PAYCaft['Close'].pct_change(1)
PAYCaft['Cumulative Return After Crash'] = (1 + PAYCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PYPL = web.DataReader('PYPL', 'yahoo', start, end)
PYPL['returns'] = PYPL['Close'].pct_change(1)
PYPL['Cumulative Return'] = (1 + PYPL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PYPLmean = PYPL['returns'].mean()
PYPLvar = PYPL['returns'].var()
PYPLkurt = PYPL['returns'].kurt()
PYPLskew = PYPL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PYPLbef = web.DataReader('PYPL', 'yahoo', start, crashstart)
PYPLbef['avgreturnbefore'] = PYPLbef['Close'].pct_change(1)
PYPLbef['Cumulative Return Before Crash'] = (1 + PYPLbef['avgreturnbefore']).cumprod()
#period of crash
PYPLdur = web.DataReader('PYPL', 'yahoo', crashstart, crashend)
PYPLdur['avgreturnduring'] = PYPLdur['Close'].pct_change(1)
PYPLdur['Cumulative Return During Crash'] = (1 + PYPLdur['avgreturnduring']).cumprod()
#period after crash
PYPLaft = web.DataReader('PYPL', 'yahoo', crashend, end)
PYPLaft['avgreturnafter'] = PYPLaft['Close'].pct_change(1)
PYPLaft['Cumulative Return After Crash'] = (1 + PYPLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
QRVO = web.DataReader('QRVO', 'yahoo', start, end)
QRVO['returns'] = QRVO['Close'].pct_change(1)
QRVO['Cumulative Return'] = (1 + QRVO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
QRVOmean = QRVO['returns'].mean()
QRVOvar = QRVO['returns'].var()
QRVOkurt = QRVO['returns'].kurt()
QRVOskew = QRVO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
QRVObef = web.DataReader('QRVO', 'yahoo', start, crashstart)
QRVObef['avgreturnbefore'] = QRVObef['Close'].pct_change(1)
QRVObef['Cumulative Return Before Crash'] = (1 + QRVObef['avgreturnbefore']).cumprod()
#period of crash
QRVOdur = web.DataReader('QRVO', 'yahoo', crashstart, crashend)
QRVOdur['avgreturnduring'] = QRVOdur['Close'].pct_change(1)
QRVOdur['Cumulative Return During Crash'] = (1 + QRVOdur['avgreturnduring']).cumprod()
#period after crash
QRVOaft = web.DataReader('QRVO', 'yahoo', crashend, end)
QRVOaft['avgreturnafter'] = QRVOaft['Close'].pct_change(1)
QRVOaft['Cumulative Return After Crash'] = (1 + QRVOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
QCOM = web.DataReader('QCOM', 'yahoo', start, end)
QCOM['returns'] = QCOM['Close'].pct_change(1)
QCOM['Cumulative Return'] = (1 + QCOM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
QCOMmean = QCOM['returns'].mean()
QCOMvar = QCOM['returns'].var()
QCOMkurt = QCOM['returns'].kurt()
QCOMskew = QCOM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
QCOMbef = web.DataReader('QCOM', 'yahoo', start, crashstart)
QCOMbef['avgreturnbefore'] = QCOMbef['Close'].pct_change(1)
QCOMbef['Cumulative Return Before Crash'] = (1 + QCOMbef['avgreturnbefore']).cumprod()
#period of crash
QCOMdur = web.DataReader('QCOM', 'yahoo', crashstart, crashend)
QCOMdur['avgreturnduring'] = QCOMdur['Close'].pct_change(1)
QCOMdur['Cumulative Return During Crash'] = (1 + QCOMdur['avgreturnduring']).cumprod()
#period after crash
QCOMaft = web.DataReader('QCOM', 'yahoo', crashend, end)
QCOMaft['avgreturnafter'] = QCOMaft['Close'].pct_change(1)
QCOMaft['Cumulative Return After Crash'] = (1 + QCOMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CRM = web.DataReader('CRM', 'yahoo', start, end)
CRM['returns'] = CRM['Close'].pct_change(1)
CRM['Cumulative Return'] = (1 + CRM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CRMmean = CRM['returns'].mean()
CRMvar = CRM['returns'].var()
CRMkurt = CRM['returns'].kurt()
CRMskew = CRM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CRMbef = web.DataReader('CRM', 'yahoo', start, crashstart)
CRMbef['avgreturnbefore'] = CRMbef['Close'].pct_change(1)
CRMbef['Cumulative Return Before Crash'] = (1 + CRMbef['avgreturnbefore']).cumprod()
#period of crash
CRMdur = web.DataReader('CRM', 'yahoo', crashstart, crashend)
CRMdur['avgreturnduring'] = CRMdur['Close'].pct_change(1)
CRMdur['Cumulative Return During Crash'] = (1 + CRMdur['avgreturnduring']).cumprod()
#period after crash
CRMaft = web.DataReader('CRM', 'yahoo', crashend, end)
CRMaft['avgreturnafter'] = CRMaft['Close'].pct_change(1)
CRMaft['Cumulative Return After Crash'] = (1 + CRMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
STX = web.DataReader('STX', 'yahoo', start, end)
STX['returns'] = STX['Close'].pct_change(1)
STX['Cumulative Return'] = (1 + STX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
STXmean = STX['returns'].mean()
STXvar = STX['returns'].var()
STXkurt = STX['returns'].kurt()
STXskew = STX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
STXbef = web.DataReader('STX', 'yahoo', start, crashstart)
STXbef['avgreturnbefore'] = STXbef['Close'].pct_change(1)
STXbef['Cumulative Return Before Crash'] = (1 + STXbef['avgreturnbefore']).cumprod()
#period of crash
STXdur = web.DataReader('STX', 'yahoo', crashstart, crashend)
STXdur['avgreturnduring'] = STXdur['Close'].pct_change(1)
STXdur['Cumulative Return During Crash'] = (1 + STXdur['avgreturnduring']).cumprod()
#period after crash
STXaft = web.DataReader('STX', 'yahoo', crashend, end)
STXaft['avgreturnafter'] = STXaft['Close'].pct_change(1)
STXaft['Cumulative Return After Crash'] = (1 + STXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NOW = web.DataReader('NOW', 'yahoo', start, end)
NOW['returns'] = NOW['Close'].pct_change(1)
NOW['Cumulative Return'] = (1 + NOW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NOWmean = NOW['returns'].mean()
NOWvar = NOW['returns'].var()
NOWkurt = NOW['returns'].kurt()
NOWskew = NOW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NOWbef = web.DataReader('NOW', 'yahoo', start, crashstart)
NOWbef['avgreturnbefore'] = NOWbef['Close'].pct_change(1)
NOWbef['Cumulative Return Before Crash'] = (1 + NOWbef['avgreturnbefore']).cumprod()
#period of crash
NOWdur = web.DataReader('NOW', 'yahoo', crashstart, crashend)
NOWdur['avgreturnduring'] = NOWdur['Close'].pct_change(1)
NOWdur['Cumulative Return During Crash'] = (1 + NOWdur['avgreturnduring']).cumprod()
#period after crash
NOWaft = web.DataReader('NOW', 'yahoo', crashend, end)
NOWaft['avgreturnafter'] = NOWaft['Close'].pct_change(1)
NOWaft['Cumulative Return After Crash'] = (1 + NOWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SWKS = web.DataReader('SWKS', 'yahoo', start, end)
SWKS['returns'] = SWKS['Close'].pct_change(1)
SWKS['Cumulative Return'] = (1 + SWKS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SWKSmean = SWKS['returns'].mean()
SWKSvar = SWKS['returns'].var()
SWKSkurt = SWKS['returns'].kurt()
SWKSskew = SWKS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SWKSbef = web.DataReader('SWKS', 'yahoo', start, crashstart)
SWKSbef['avgreturnbefore'] = SWKSbef['Close'].pct_change(1)
SWKSbef['Cumulative Return Before Crash'] = (1 + SWKSbef['avgreturnbefore']).cumprod()
#period of crash
SWKSdur = web.DataReader('SWKS', 'yahoo', crashstart, crashend)
SWKSdur['avgreturnduring'] = SWKSdur['Close'].pct_change(1)
SWKSdur['Cumulative Return During Crash'] = (1 + SWKSdur['avgreturnduring']).cumprod()
#period after crash
SWKSaft = web.DataReader('SWKS', 'yahoo', crashend, end)
SWKSaft['avgreturnafter'] = SWKSaft['Close'].pct_change(1)
SWKSaft['Cumulative Return After Crash'] = (1 + SWKSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SNPS = web.DataReader('SNPS', 'yahoo', start, end)
SNPS['returns'] = SNPS['Close'].pct_change(1)
SNPS['Cumulative Return'] = (1 + SNPS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SNPSmean = SNPS['returns'].mean()
SNPSvar = SNPS['returns'].var()
SNPSkurt = SNPS['returns'].kurt()
SNPSskew = SNPS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SNPSbef = web.DataReader('SNPS', 'yahoo', start, crashstart)
SNPSbef['avgreturnbefore'] = SNPSbef['Close'].pct_change(1)
SNPSbef['Cumulative Return Before Crash'] = (1 + SNPSbef['avgreturnbefore']).cumprod()
#period of crash
SNPSdur = web.DataReader('SNPS', 'yahoo', crashstart, crashend)
SNPSdur['avgreturnduring'] = SNPSdur['Close'].pct_change(1)
SNPSdur['Cumulative Return During Crash'] = (1 + SNPSdur['avgreturnduring']).cumprod()
#period after crash
SNPSaft = web.DataReader('SNPS', 'yahoo', crashend, end)
SNPSaft['avgreturnafter'] = SNPSaft['Close'].pct_change(1)
SNPSaft['Cumulative Return After Crash'] = (1 + SNPSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TEL = web.DataReader('TEL', 'yahoo', start, end)
TEL['returns'] = TEL['Close'].pct_change(1)
TEL['Cumulative Return'] = (1 + TEL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TELmean = TEL['returns'].mean()
TELvar = TEL['returns'].var()
TELkurt = TEL['returns'].kurt()
TELskew = TEL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TELbef = web.DataReader('TEL', 'yahoo', start, crashstart)
TELbef['avgreturnbefore'] = TELbef['Close'].pct_change(1)
TELbef['Cumulative Return Before Crash'] = (1 + TELbef['avgreturnbefore']).cumprod()
#period of crash
TELdur = web.DataReader('TEL', 'yahoo', crashstart, crashend)
TELdur['avgreturnduring'] = TELdur['Close'].pct_change(1)
TELdur['Cumulative Return During Crash'] = (1 + TELdur['avgreturnduring']).cumprod()
#period after crash
TELaft = web.DataReader('TEL', 'yahoo', crashend, end)
TELaft['avgreturnafter'] = TELaft['Close'].pct_change(1)
TELaft['Cumulative Return After Crash'] = (1 + TELaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TXN = web.DataReader('TXN', 'yahoo', start, end)
TXN['returns'] = TXN['Close'].pct_change(1)
TXN['Cumulative Return'] = (1 + TXN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TXNmean = TXN['returns'].mean()
TXNvar = TXN['returns'].var()
TXNkurt = TXN['returns'].kurt()
TXNskew = TXN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TXNbef = web.DataReader('TXN', 'yahoo', start, crashstart)
TXNbef['avgreturnbefore'] = TXNbef['Close'].pct_change(1)
TXNbef['Cumulative Return Before Crash'] = (1 + TXNbef['avgreturnbefore']).cumprod()
#period of crash
TXNdur = web.DataReader('TXN', 'yahoo', crashstart, crashend)
TXNdur['avgreturnduring'] = TXNdur['Close'].pct_change(1)
TXNdur['Cumulative Return During Crash'] = (1 + TXNdur['avgreturnduring']).cumprod()
#period after crash
TXNaft = web.DataReader('TXN', 'yahoo', crashend, end)
TXNaft['avgreturnafter'] = TXNaft['Close'].pct_change(1)
TXNaft['Cumulative Return After Crash'] = (1 + TXNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
VRSN = web.DataReader('VRSN', 'yahoo', start, end)
VRSN['returns'] = VRSN['Close'].pct_change(1)
VRSN['Cumulative Return'] = (1 + VRSN['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
VRSNmean = VRSN['returns'].mean()
VRSNvar = VRSN['returns'].var()
VRSNkurt = VRSN['returns'].kurt()
VRSNskew = VRSN['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
VRSNbef = web.DataReader('VRSN', 'yahoo', start, crashstart)
VRSNbef['avgreturnbefore'] = VRSNbef['Close'].pct_change(1)
VRSNbef['Cumulative Return Before Crash'] = (1 + VRSNbef['avgreturnbefore']).cumprod()
#period of crash
VRSNdur = web.DataReader('VRSN', 'yahoo', crashstart, crashend)
VRSNdur['avgreturnduring'] = VRSNdur['Close'].pct_change(1)
VRSNdur['Cumulative Return During Crash'] = (1 + VRSNdur['avgreturnduring']).cumprod()
#period after crash
VRSNaft = web.DataReader('VRSN', 'yahoo', crashend, end)
VRSNaft['avgreturnafter'] = VRSNaft['Close'].pct_change(1)
VRSNaft['Cumulative Return After Crash'] = (1 + VRSNaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
V = web.DataReader('V', 'yahoo', start, end)
V['returns'] = V['Close'].pct_change(1)
V['Cumulative Return'] = (1 + V['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
Vmean = V['returns'].mean()
Vvar = V['returns'].var()
Vkurt = V['returns'].kurt()
Vskew = V['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
Vbef = web.DataReader('V', 'yahoo', start, crashstart)
Vbef['avgreturnbefore'] = Vbef['Close'].pct_change(1)
Vbef['Cumulative Return Before Crash'] = (1 + Vbef['avgreturnbefore']).cumprod()
#period of crash
Vdur = web.DataReader('V', 'yahoo', crashstart, crashend)
Vdur['avgreturnduring'] = Vdur['Close'].pct_change(1)
Vdur['Cumulative Return During Crash'] = (1 + Vdur['avgreturnduring']).cumprod()
#period after crash
Vaft = web.DataReader('V', 'yahoo', crashend, end)
Vaft['avgreturnafter'] = Vaft['Close'].pct_change(1)
Vaft['Cumulative Return After Crash'] = (1 + Vaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WDC = web.DataReader('WDC', 'yahoo', start, end)
WDC['returns'] = WDC['Close'].pct_change(1)
WDC['Cumulative Return'] = (1 + WDC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WDCmean = WDC['returns'].mean()
WDCvar = WDC['returns'].var()
WDCkurt = WDC['returns'].kurt()
WDCskew = WDC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WDCbef = web.DataReader('WDC', 'yahoo', start, crashstart)
WDCbef['avgreturnbefore'] = WDCbef['Close'].pct_change(1)
WDCbef['Cumulative Return Before Crash'] = (1 + WDCbef['avgreturnbefore']).cumprod()
#period of crash
WDCdur = web.DataReader('WDC', 'yahoo', crashstart, crashend)
WDCdur['avgreturnduring'] = WDCdur['Close'].pct_change(1)
WDCdur['Cumulative Return During Crash'] = (1 + WDCdur['avgreturnduring']).cumprod()
#period after crash
WDCaft = web.DataReader('WDC', 'yahoo', crashend, end)
WDCaft['avgreturnafter'] = WDCaft['Close'].pct_change(1)
WDCaft['Cumulative Return After Crash'] = (1 + WDCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WU = web.DataReader('WU', 'yahoo', start, end)
WU['returns'] = WU['Close'].pct_change(1)
WU['Cumulative Return'] = (1 + WU['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WUmean = WU['returns'].mean()
WUvar = WU['returns'].var()
WUkurt = WU['returns'].kurt()
WUskew = WU['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WUbef = web.DataReader('WU', 'yahoo', start, crashstart)
WUbef['avgreturnbefore'] = WUbef['Close'].pct_change(1)
WUbef['Cumulative Return Before Crash'] = (1 + WUbef['avgreturnbefore']).cumprod()
#period of crash
WUdur = web.DataReader('WU', 'yahoo', crashstart, crashend)
WUdur['avgreturnduring'] = WUdur['Close'].pct_change(1)
WUdur['Cumulative Return During Crash'] = (1 + WUdur['avgreturnduring']).cumprod()
#period after crash
WUaft = web.DataReader('WU', 'yahoo', crashend, end)
WUaft['avgreturnafter'] = WUaft['Close'].pct_change(1)
WUaft['Cumulative Return After Crash'] = (1 + WUaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
XRX = web.DataReader('XRX', 'yahoo', start, end)
XRX['returns'] = XRX['Close'].pct_change(1)
XRX['Cumulative Return'] = (1 + XRX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
XRXmean = XRX['returns'].mean()
XRXvar = XRX['returns'].var()
XRXkurt = XRX['returns'].kurt()
XRXskew = XRX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
XRXbef = web.DataReader('XRX', 'yahoo', start, crashstart)
XRXbef['avgreturnbefore'] = XRXbef['Close'].pct_change(1)
XRXbef['Cumulative Return Before Crash'] = (1 + XRXbef['avgreturnbefore']).cumprod()
#period of crash
XRXdur = web.DataReader('XRX', 'yahoo', crashstart, crashend)
XRXdur['avgreturnduring'] = XRXdur['Close'].pct_change(1)
XRXdur['Cumulative Return During Crash'] = (1 + XRXdur['avgreturnduring']).cumprod()
#period after crash
XRXaft = web.DataReader('XRX', 'yahoo', crashend, end)
XRXaft['avgreturnafter'] = XRXaft['Close'].pct_change(1)
XRXaft['Cumulative Return After Crash'] = (1 + XRXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
XLNX = web.DataReader('XLNX', 'yahoo', start, end)
XLNX['returns'] = XLNX['Close'].pct_change(1)
XLNX['Cumulative Return'] = (1 + XLNX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
XLNXmean = XLNX['returns'].mean()
XLNXvar = XLNX['returns'].var()
XLNXkurt = XLNX['returns'].kurt()
XLNXskew = XLNX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
XLNXbef = web.DataReader('XLNX', 'yahoo', start, crashstart)
XLNXbef['avgreturnbefore'] = XLNXbef['Close'].pct_change(1)
XLNXbef['Cumulative Return Before Crash'] = (1 + XLNXbef['avgreturnbefore']).cumprod()
#period of crash
XLNXdur = web.DataReader('XLNX', 'yahoo', crashstart, crashend)
XLNXdur['avgreturnduring'] = XLNXdur['Close'].pct_change(1)
XLNXdur['Cumulative Return During Crash'] = (1 + XLNXdur['avgreturnduring']).cumprod()
#period after crash
XLNXaft = web.DataReader('XLNX', 'yahoo', crashend, end)
XLNXaft['avgreturnafter'] = XLNXaft['Close'].pct_change(1)
XLNXaft['Cumulative Return After Crash'] = (1 + XLNXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ZBRA = web.DataReader('ZBRA', 'yahoo', start, end)
ZBRA['returns'] = ZBRA['Close'].pct_change(1)
ZBRA['Cumulative Return'] = (1 + ZBRA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ZBRAmean = ZBRA['returns'].mean()
ZBRAvar = ZBRA['returns'].var()
ZBRAkurt = ZBRA['returns'].kurt()
ZBRAskew = ZBRA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ZBRAbef = web.DataReader('ZBRA', 'yahoo', start, crashstart)
ZBRAbef['avgreturnbefore'] = ZBRAbef['Close'].pct_change(1)
ZBRAbef['Cumulative Return Before Crash'] = (1 + ZBRAbef['avgreturnbefore']).cumprod()
#period of crash
ZBRAdur = web.DataReader('ZBRA', 'yahoo', crashstart, crashend)
ZBRAdur['avgreturnduring'] = ZBRAdur['Close'].pct_change(1)
ZBRAdur['Cumulative Return During Crash'] = (1 + ZBRAdur['avgreturnduring']).cumprod()
#period after crash
ZBRAaft = web.DataReader('ZBRA', 'yahoo', crashend, end)
ZBRAaft['avgreturnafter'] = ZBRAaft['Close'].pct_change(1)
ZBRAaft['Cumulative Return After Crash'] = (1 + ZBRAaft['avgreturnafter']).cumprod()
#KDE Plot for Information Technology Sector
sp['returns'].plot(kind = 'kde', label ='S&P 500', alpha=0.5)
ACN['returns'].plot(kind = 'kde', label ='ACN', figsize = (10,8), alpha=0.5, title = 'KDE of Information Technology Stocks')
ADBE['returns'].plot(kind = 'kde', label ='ADBE', alpha=0.5)
AMD['returns'].plot(kind = 'kde', label ='AMD', alpha=0.5)
AKAM['returns'].plot(kind = 'kde', label ='AKAM', alpha=0.5)
ADS['returns'].plot(kind = 'kde', label ='ADS', alpha=0.5)
APH['returns'].plot(kind = 'kde', label ='APH', alpha=0.5)
ADI['returns'].plot(kind = 'kde', label ='ADI', alpha=0.5)
ANSS['returns'].plot(kind = 'kde', label ='ANSS', alpha=0.5)
AAPL['returns'].plot(kind = 'kde', label ='AAPL', alpha=0.5)
AMAT['returns'].plot(kind = 'kde', label ='AMAT', alpha=0.5)
ANET['returns'].plot(kind = 'kde', label ='ANET', alpha=0.5)
ADSK['returns'].plot(kind = 'kde', label ='ADSK', alpha=0.5)
ADP['returns'].plot(kind = 'kde', label ='ADP', alpha=0.5)
AVGO['returns'].plot(kind = 'kde', label ='AVGO', alpha=0.5)
BR['returns'].plot(kind = 'kde', label = 'BR', alpha=0.5)
CDNS['returns'].plot(kind = 'kde', label ='CDNS', alpha=0.5)
CDW['returns'].plot(kind = 'kde', label ='CDW', alpha=0.5)
CSCO['returns'].plot(kind = 'kde', label ='CSCO', alpha=0.5)
CTXS['returns'].plot(kind = 'kde', label ='CTXS', alpha=0.5)
CTSH['returns'].plot(kind = 'kde', label ='CTSH', alpha=0.5)
GLW['returns'].plot(kind = 'kde', label ='GLW', alpha=0.5)
DXC['returns'].plot(kind = 'kde', label ='DXC', alpha=0.5)
FFIV['returns'].plot(kind = 'kde', label ='FFIV', alpha=0.5)
FIS['returns'].plot(kind = 'kde', label ='FIS', alpha=0.5)
FISV['returns'].plot(kind = 'kde', label ='FISV', alpha=0.5)
FLT['returns'].plot(kind = 'kde', label ='FLT', alpha=0.5)
FLIR['returns'].plot(kind = 'kde', label ='FLIR', alpha=0.5)
FTNT['returns'].plot(kind = 'kde', label ='FTNT', alpha=0.5)
IT['returns'].plot(kind = 'kde', label ='IT', alpha=0.5)
GPN['returns'].plot(kind = 'kde', label ='GPN', alpha=0.5)
HPE['returns'].plot(kind = 'kde', label ='HPE', alpha=0.5)
HPQ['returns'].plot(kind = 'kde', label ='HPQ', alpha=0.5)
INTC['returns'].plot(kind = 'kde', label ='INTC', alpha=0.5)
IBM['returns'].plot(kind = 'kde', label ='IBM', alpha=0.5)
INTU['returns'].plot(kind = 'kde', label ='INTU', alpha=0.5)
IPGP['returns'].plot(kind = 'kde', label ='IPGP', alpha=0.5)
JKHY['returns'].plot(kind = 'kde', label ='JKHY', alpha=0.5)
JNPR['returns'].plot(kind = 'kde', label ='JNPR', alpha=0.5)
KEYS['returns'].plot(kind = 'kde', label ='KEYS', alpha=0.5)
KLAC['returns'].plot(kind = 'kde', label ='KLAC', alpha=0.5)
LRCX['returns'].plot(kind = 'kde', label ='LRCX', alpha=0.5)
LDOS['returns'].plot(kind = 'kde', label ='LDOS', alpha=0.5)
MA['returns'].plot(kind = 'kde', label ='MA', alpha=0.5)
MXIM['returns'].plot(kind = 'kde', label ='MXIM', alpha=0.5)
MCHP['returns'].plot(kind = 'kde', label ='MCHP', alpha=0.5)
MU['returns'].plot(kind = 'kde', label ='MU', alpha=0.5)
MSFT['returns'].plot(kind = 'kde', label ='MSFT', alpha=0.5)
MSI['returns'].plot(kind = 'kde', label ='MSI', alpha=0.5)
NTAP['returns'].plot(kind = 'kde', label ='NTAP', alpha=0.5)
NLOK['returns'].plot(kind = 'kde', label ='NLOK', alpha=0.5)
NVDA['returns'].plot(kind = 'kde', label ='NVDA', alpha=0.5)
ORCL['returns'].plot(kind = 'kde', label ='ORCL', alpha=0.5)
PAYX['returns'].plot(kind = 'kde', label ='PAYX', alpha=0.5)
PAYC['returns'].plot(kind = 'kde', label ='PAYC', alpha=0.5)
PYPL['returns'].plot(kind = 'kde', label ='PYPL', alpha=0.5)
QRVO['returns'].plot(kind = 'kde', label ='QRVO', alpha=0.5)
QCOM['returns'].plot(kind = 'kde', label ='QCOM', alpha=0.5)
CRM['returns'].plot(kind = 'kde', label ='CRM', alpha=0.5)
STX['returns'].plot(kind = 'kde', label ='STX', alpha=0.5)
NOW['returns'].plot(kind = 'kde', label ='NOW', alpha=0.5)
SWKS['returns'].plot(kind = 'kde', label ='SWKS', alpha=0.5)
SNPS['returns'].plot(kind = 'kde', label ='SNPS', alpha=0.5)
TEL['returns'].plot(kind = 'kde', label ='TEL', alpha=0.5)
TXN['returns'].plot(kind = 'kde', label ='TXN', alpha=0.5)
VRSN['returns'].plot(kind = 'kde', label ='VRSN', alpha=0.5)
V['returns'].plot(kind = 'kde', label ='V', alpha=0.5)
WDC['returns'].plot(kind = 'kde', label ='WDC', alpha=0.5)
WU['returns'].plot(kind = 'kde', label ='WU', alpha=0.5)
XRX['returns'].plot(kind = 'kde', label ='XRX', alpha=0.5)
XLNX['returns'].plot(kind = 'kde', label ='XLNX', alpha=0.5)
ZBRA['returns'].plot(kind = 'kde', label ='ZBRA', alpha=0.5)
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Boxplots comparing returns for Information Technology Sector
box_df = pd.concat([sp['returns'],ACN['returns'],ADBE['returns'],AMD['returns'],AKAM['returns'],ADS['returns'],APH['returns'],ADI['returns'],ANSS['returns'],AAPL['returns'],AMAT['returns'],ANET['returns'],ADSK['returns'],ADP['returns'],AVGO['returns'],BR['returns'],CDNS['returns'],CDW['returns'],CSCO['returns'],CTXS['returns'],CTSH['returns'],GLW['returns'],DXC['returns'],FFIV['returns'],FIS['returns'],FISV['returns'],FLT['returns'],FLIR['returns'],FTNT['returns'],IT['returns'],GPN['returns'],HPE['returns'],HPQ['returns'],INTC['returns'],IBM['returns'],INTU['returns'],IPGP['returns'],JKHY['returns'],JNPR['returns'],KEYS['returns'],KLAC['returns'],LRCX['returns'],LDOS['returns'],MA['returns'],MXIM['returns'],MCHP['returns'],MU['returns'],MSFT['returns'],MSI['returns'],NTAP['returns'],NLOK['returns'],NVDA['returns'],ORCL['returns'],PAYX['returns'],PAYC['returns'],PYPL['returns'],QRVO['returns'],QCOM['returns'],CRM['returns'],STX['returns'],NOW['returns'],SWKS['returns'],SNPS['returns'],TEL['returns'],TXN['returns'],VRSN['returns'],V['returns'],WDC['returns'],WU['returns'],XRX['returns'],XLNX['returns'],ZBRA['returns']], axis=1)
box_df.columns = ['S&P 500','ACN','ADBE','AMD','AKAM','ADS','APH','ADI','ANSS','AAPL','AMAT','ANET','ADSK','ADP','AVGO','BR','CDNS','CDW','CSCO','CTXS','CTSH','GLW','DXC','FFIV','FIS','FISV','FLT','FLIR','FTNT','IT','GPN','HPE','HPQ','INTC','IBM','INTU','IPGP','JKHY','JNPR','KEYS','KLAC','LRCX','LDOS','MA','MXIM','MCHP','MU','MSFT','MSI','NTAP','NLOK','NVDA','ORCL','PAYX','PAYC','PYPL','QRVO','QCOM','CRM','STX','NOW','SWKS','SNPS','TEL','TXN','VRSN','V','WDC','WU','XRX','XLNX','ZBRA',]
box_df.plot(kind='box', figsize=(30,10), colormap= 'jet', title = 'Boxplots of Information Technology Sector Returns')
#Cumulative Returns of Information Technology Stocks for Whole period
sp['Cumulative Return'].plot(label="S&P 500")
ACN['Cumulative Return'].plot(label='ACN', figsize=(16,8), title = 'Cumulative Return of Information Technology Stocks')
ADBE['Cumulative Return'].plot(label="ADBE")
AMD['Cumulative Return'].plot(label="AMD")
AKAM['Cumulative Return'].plot(label="AKAM")
ADS['Cumulative Return'].plot(label="ADS")
APH['Cumulative Return'].plot(label="APH")
ADI['Cumulative Return'].plot(label="ADI")
ANSS['Cumulative Return'].plot(label="ANSS")
AAPL['Cumulative Return'].plot(label="AAPL")
AMAT['Cumulative Return'].plot(label="AMAT")
ANET['Cumulative Return'].plot(label="ANET")
ADSK['Cumulative Return'].plot(label="ADSK")
ADP['Cumulative Return'].plot(label="ADP")
AVGO['Cumulative Return'].plot(label="AVGO")
BR['Cumulative Return'].plot(label="BR")
CDNS['Cumulative Return'].plot(label="CDNS")
CDW['Cumulative Return'].plot(label="CDW")
CSCO['Cumulative Return'].plot(label="CSCO")
CTXS['Cumulative Return'].plot(label="CTXS")
CTSH['Cumulative Return'].plot(label="CTSH")
GLW['Cumulative Return'].plot(label="GLW")
DXC['Cumulative Return'].plot(label="DXC")
FFIV['Cumulative Return'].plot(label="FFIV")
FIS['Cumulative Return'].plot(label="FIS")
FISV['Cumulative Return'].plot(label="FISV")
FLT['Cumulative Return'].plot(label="FLT")
FLIR['Cumulative Return'].plot(label="FLIR")
FTNT['Cumulative Return'].plot(label="FTNT")
IT['Cumulative Return'].plot(label="IT")
GPN['Cumulative Return'].plot(label="GPN")
HPE['Cumulative Return'].plot(label="HPE")
HPQ['Cumulative Return'].plot(label="HPQ")
INTC['Cumulative Return'].plot(label="INTC")
IBM['Cumulative Return'].plot(label="IBM")
INTU['Cumulative Return'].plot(label="INTU")
IPGP['Cumulative Return'].plot(label="IPGP")
JKHY['Cumulative Return'].plot(label="JKHY")
JNPR['Cumulative Return'].plot(label="JNPR")
KEYS['Cumulative Return'].plot(label="KEYS")
KLAC['Cumulative Return'].plot(label="KLAC")
LRCX['Cumulative Return'].plot(label="LRCX")
LDOS['Cumulative Return'].plot(label="LDOS")
MA['Cumulative Return'].plot(label="MA")
MXIM['Cumulative Return'].plot(label="MXIM")
MCHP['Cumulative Return'].plot(label="MCHP")
MU['Cumulative Return'].plot(label="MU")
MSFT['Cumulative Return'].plot(label="MSFT")
MSI['Cumulative Return'].plot(label="MSI")
NTAP['Cumulative Return'].plot(label="NTAP")
NLOK['Cumulative Return'].plot(label="NLOK")
NVDA['Cumulative Return'].plot(label="NVDA")
ORCL['Cumulative Return'].plot(label="ORCL")
PAYX['Cumulative Return'].plot(label="PAYX")
PAYC['Cumulative Return'].plot(label="PAYC")
PYPL['Cumulative Return'].plot(label="PYPL")
QRVO['Cumulative Return'].plot(label="QRVO")
QCOM['Cumulative Return'].plot(label="QCOM")
CRM['Cumulative Return'].plot(label="CRM")
STX['Cumulative Return'].plot(label="STX")
NOW['Cumulative Return'].plot(label="NOW")
SWKS['Cumulative Return'].plot(label="SWKS")
SNPS['Cumulative Return'].plot(label="SNPS")
TEL['Cumulative Return'].plot(label="TEL")
TXN['Cumulative Return'].plot(label="TXN")
VRSN['Cumulative Return'].plot(label="VRSN")
V['Cumulative Return'].plot(label="V")
WDC['Cumulative Return'].plot(label="WDC")
WU['Cumulative Return'].plot(label="WU")
XRX['Cumulative Return'].plot(label="XRX")
XLNX['Cumulative Return'].plot(label="XLNX")
ZBRA['Cumulative Return'].plot(label="ZBRA")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Sorting by Cumulative Return
cumret = {'Cumulative Returns 12/4-6/5': [sp['Cumulative Return'].iloc[-1],ACN['Cumulative Return'].iloc[-1],ADBE['Cumulative Return'].iloc[-1],AMD['Cumulative Return'].iloc[-1],AKAM['Cumulative Return'].iloc[-1],ADS['Cumulative Return'].iloc[-1],APH['Cumulative Return'].iloc[-1],ADI['Cumulative Return'].iloc[-1],ANSS['Cumulative Return'].iloc[-1],AAPL['Cumulative Return'].iloc[-1],AMAT['Cumulative Return'].iloc[-1],ANET['Cumulative Return'].iloc[-1],ADSK['Cumulative Return'].iloc[-1],ADP['Cumulative Return'].iloc[-1],AVGO['Cumulative Return'].iloc[-1],BR['Cumulative Return'].iloc[-1],CDNS['Cumulative Return'].iloc[-1],CDW['Cumulative Return'].iloc[-1],CSCO['Cumulative Return'].iloc[-1],CTXS['Cumulative Return'].iloc[-1],CTSH['Cumulative Return'].iloc[-1],GLW['Cumulative Return'].iloc[-1],DXC['Cumulative Return'].iloc[-1],FFIV['Cumulative Return'].iloc[-1],FIS['Cumulative Return'].iloc[-1],FISV['Cumulative Return'].iloc[-1],FLT['Cumulative Return'].iloc[-1],FLIR['Cumulative Return'].iloc[-1],FTNT['Cumulative Return'].iloc[-1],IT['Cumulative Return'].iloc[-1],GPN['Cumulative Return'].iloc[-1],HPE['Cumulative Return'].iloc[-1],HPQ['Cumulative Return'].iloc[-1],INTC['Cumulative Return'].iloc[-1],IBM['Cumulative Return'].iloc[-1],INTU['Cumulative Return'].iloc[-1],IPGP['Cumulative Return'].iloc[-1],JKHY['Cumulative Return'].iloc[-1],JNPR['Cumulative Return'].iloc[-1],KEYS['Cumulative Return'].iloc[-1],KLAC['Cumulative Return'].iloc[-1],LRCX['Cumulative Return'].iloc[-1],LDOS['Cumulative Return'].iloc[-1],MA['Cumulative Return'].iloc[-1],MXIM['Cumulative Return'].iloc[-1],MCHP['Cumulative Return'].iloc[-1],MU['Cumulative Return'].iloc[-1],MSFT['Cumulative Return'].iloc[-1],MSI['Cumulative Return'].iloc[-1],NTAP['Cumulative Return'].iloc[-1],NLOK['Cumulative Return'].iloc[-1],NVDA['Cumulative Return'].iloc[-1],ORCL['Cumulative Return'].iloc[-1],PAYX['Cumulative Return'].iloc[-1],PAYC['Cumulative Return'].iloc[-1],PYPL['Cumulative Return'].iloc[-1],QRVO['Cumulative Return'].iloc[-1],QCOM['Cumulative Return'].iloc[-1],CRM['Cumulative Return'].iloc[-1],STX['Cumulative Return'].iloc[-1],NOW['Cumulative Return'].iloc[-1],SWKS['Cumulative Return'].iloc[-1],SNPS['Cumulative Return'].iloc[-1],TEL['Cumulative Return'].iloc[-1],TXN['Cumulative Return'].iloc[-1],VRSN['Cumulative Return'].iloc[-1],V['Cumulative Return'].iloc[-1],WDC['Cumulative Return'].iloc[-1],WU['Cumulative Return'].iloc[-1],XRX['Cumulative Return'].iloc[-1],XLNX['Cumulative Return'].iloc[-1],ZBRA['Cumulative Return'].iloc[-1]],
'Cumulative Returns 12/4-2/20': [spbef['Cumulative Return Before Crash'].iloc[-1],ACNbef['Cumulative Return Before Crash'].iloc[-1],ADBEbef['Cumulative Return Before Crash'].iloc[-1],AMDbef['Cumulative Return Before Crash'].iloc[-1],AKAMbef['Cumulative Return Before Crash'].iloc[-1],ADSbef['Cumulative Return Before Crash'].iloc[-1],APHbef['Cumulative Return Before Crash'].iloc[-1],ADIbef['Cumulative Return Before Crash'].iloc[-1],ANSSbef['Cumulative Return Before Crash'].iloc[-1],AAPLbef['Cumulative Return Before Crash'].iloc[-1],AMATbef['Cumulative Return Before Crash'].iloc[-1],ANETbef['Cumulative Return Before Crash'].iloc[-1],ADSKbef['Cumulative Return Before Crash'].iloc[-1],ADPbef['Cumulative Return Before Crash'].iloc[-1],AVGObef['Cumulative Return Before Crash'].iloc[-1],BRbef['Cumulative Return Before Crash'].iloc[-1],CDNSbef['Cumulative Return Before Crash'].iloc[-1],CDWbef['Cumulative Return Before Crash'].iloc[-1],CSCObef['Cumulative Return Before Crash'].iloc[-1],CTXSbef['Cumulative Return Before Crash'].iloc[-1],CTSHbef['Cumulative Return Before Crash'].iloc[-1],GLWbef['Cumulative Return Before Crash'].iloc[-1],DXCbef['Cumulative Return Before Crash'].iloc[-1],FFIVbef['Cumulative Return Before Crash'].iloc[-1],FISbef['Cumulative Return Before Crash'].iloc[-1],FISVbef['Cumulative Return Before Crash'].iloc[-1],FLTbef['Cumulative Return Before Crash'].iloc[-1],FLIRbef['Cumulative Return Before Crash'].iloc[-1],FTNTbef['Cumulative Return Before Crash'].iloc[-1],ITbef['Cumulative Return Before Crash'].iloc[-1],GPNbef['Cumulative Return Before Crash'].iloc[-1],HPEbef['Cumulative Return Before Crash'].iloc[-1],HPQbef['Cumulative Return Before Crash'].iloc[-1],INTCbef['Cumulative Return Before Crash'].iloc[-1],IBMbef['Cumulative Return Before Crash'].iloc[-1],INTUbef['Cumulative Return Before Crash'].iloc[-1],IPGPbef['Cumulative Return Before Crash'].iloc[-1],JKHYbef['Cumulative Return Before Crash'].iloc[-1],JNPRbef['Cumulative Return Before Crash'].iloc[-1],KEYSbef['Cumulative Return Before Crash'].iloc[-1],KLACbef['Cumulative Return Before Crash'].iloc[-1],LRCXbef['Cumulative Return Before Crash'].iloc[-1],LDOSbef['Cumulative Return Before Crash'].iloc[-1],MAbef['Cumulative Return Before Crash'].iloc[-1],MXIMbef['Cumulative Return Before Crash'].iloc[-1],MCHPbef['Cumulative Return Before Crash'].iloc[-1],MUbef['Cumulative Return Before Crash'].iloc[-1],MSFTbef['Cumulative Return Before Crash'].iloc[-1],MSIbef['Cumulative Return Before Crash'].iloc[-1],NTAPbef['Cumulative Return Before Crash'].iloc[-1],NLOKbef['Cumulative Return Before Crash'].iloc[-1],NVDAbef['Cumulative Return Before Crash'].iloc[-1],ORCLbef['Cumulative Return Before Crash'].iloc[-1],PAYXbef['Cumulative Return Before Crash'].iloc[-1],PAYCbef['Cumulative Return Before Crash'].iloc[-1],PYPLbef['Cumulative Return Before Crash'].iloc[-1],QRVObef['Cumulative Return Before Crash'].iloc[-1],QCOMbef['Cumulative Return Before Crash'].iloc[-1],CRMbef['Cumulative Return Before Crash'].iloc[-1],STXbef['Cumulative Return Before Crash'].iloc[-1],NOWbef['Cumulative Return Before Crash'].iloc[-1],SWKSbef['Cumulative Return Before Crash'].iloc[-1],SNPSbef['Cumulative Return Before Crash'].iloc[-1],TELbef['Cumulative Return Before Crash'].iloc[-1],TXNbef['Cumulative Return Before Crash'].iloc[-1],VRSNbef['Cumulative Return Before Crash'].iloc[-1],Vbef['Cumulative Return Before Crash'].iloc[-1],WDCbef['Cumulative Return Before Crash'].iloc[-1],WUbef['Cumulative Return Before Crash'].iloc[-1],XRXbef['Cumulative Return Before Crash'].iloc[-1],XLNXbef['Cumulative Return Before Crash'].iloc[-1],ZBRAbef['Cumulative Return Before Crash'].iloc[-1]],
'Cumulative Returns 2/20-3/23': [spdur['Cumulative Return During Crash'].iloc[-1],ACNdur['Cumulative Return During Crash'].iloc[-1],ADBEdur['Cumulative Return During Crash'].iloc[-1],AMDdur['Cumulative Return During Crash'].iloc[-1],AKAMdur['Cumulative Return During Crash'].iloc[-1],ADSdur['Cumulative Return During Crash'].iloc[-1],APHdur['Cumulative Return During Crash'].iloc[-1],ADIdur['Cumulative Return During Crash'].iloc[-1],ANSSdur['Cumulative Return During Crash'].iloc[-1],AAPLdur['Cumulative Return During Crash'].iloc[-1],AMATdur['Cumulative Return During Crash'].iloc[-1],ANETdur['Cumulative Return During Crash'].iloc[-1],ADSKdur['Cumulative Return During Crash'].iloc[-1],ADPdur['Cumulative Return During Crash'].iloc[-1],AVGOdur['Cumulative Return During Crash'].iloc[-1],BRdur['Cumulative Return During Crash'].iloc[-1],CDNSdur['Cumulative Return During Crash'].iloc[-1],CDWdur['Cumulative Return During Crash'].iloc[-1],CSCOdur['Cumulative Return During Crash'].iloc[-1],CTXSdur['Cumulative Return During Crash'].iloc[-1],CTSHdur['Cumulative Return During Crash'].iloc[-1],GLWdur['Cumulative Return During Crash'].iloc[-1],DXCdur['Cumulative Return During Crash'].iloc[-1],FFIVdur['Cumulative Return During Crash'].iloc[-1],FISdur['Cumulative Return During Crash'].iloc[-1],FISVdur['Cumulative Return During Crash'].iloc[-1],FLTdur['Cumulative Return During Crash'].iloc[-1],FLIRdur['Cumulative Return During Crash'].iloc[-1],FTNTdur['Cumulative Return During Crash'].iloc[-1],ITdur['Cumulative Return During Crash'].iloc[-1],GPNdur['Cumulative Return During Crash'].iloc[-1],HPEdur['Cumulative Return During Crash'].iloc[-1],HPQdur['Cumulative Return During Crash'].iloc[-1],INTCdur['Cumulative Return During Crash'].iloc[-1],IBMdur['Cumulative Return During Crash'].iloc[-1],INTUdur['Cumulative Return During Crash'].iloc[-1],IPGPdur['Cumulative Return During Crash'].iloc[-1],JKHYdur['Cumulative Return During Crash'].iloc[-1],JNPRdur['Cumulative Return During Crash'].iloc[-1],KEYSdur['Cumulative Return During Crash'].iloc[-1],KLACdur['Cumulative Return During Crash'].iloc[-1],LRCXdur['Cumulative Return During Crash'].iloc[-1],LDOSdur['Cumulative Return During Crash'].iloc[-1],MAdur['Cumulative Return During Crash'].iloc[-1],MXIMdur['Cumulative Return During Crash'].iloc[-1],MCHPdur['Cumulative Return During Crash'].iloc[-1],MUdur['Cumulative Return During Crash'].iloc[-1],MSFTdur['Cumulative Return During Crash'].iloc[-1],MSIdur['Cumulative Return During Crash'].iloc[-1],NTAPdur['Cumulative Return During Crash'].iloc[-1],NLOKdur['Cumulative Return During Crash'].iloc[-1],NVDAdur['Cumulative Return During Crash'].iloc[-1],ORCLdur['Cumulative Return During Crash'].iloc[-1],PAYXdur['Cumulative Return During Crash'].iloc[-1],PAYCdur['Cumulative Return During Crash'].iloc[-1],PYPLdur['Cumulative Return During Crash'].iloc[-1],QRVOdur['Cumulative Return During Crash'].iloc[-1],QCOMdur['Cumulative Return During Crash'].iloc[-1],CRMdur['Cumulative Return During Crash'].iloc[-1],STXdur['Cumulative Return During Crash'].iloc[-1],NOWdur['Cumulative Return During Crash'].iloc[-1],SWKSdur['Cumulative Return During Crash'].iloc[-1],SNPSdur['Cumulative Return During Crash'].iloc[-1],TELdur['Cumulative Return During Crash'].iloc[-1],TXNdur['Cumulative Return During Crash'].iloc[-1],VRSNdur['Cumulative Return During Crash'].iloc[-1],Vdur['Cumulative Return During Crash'].iloc[-1],WDCdur['Cumulative Return During Crash'].iloc[-1],WUdur['Cumulative Return During Crash'].iloc[-1],XRXdur['Cumulative Return During Crash'].iloc[-1],XLNXdur['Cumulative Return During Crash'].iloc[-1],ZBRAdur['Cumulative Return During Crash'].iloc[-1]],
'Cumulative Returns 3/23-6/5': [spaft['Cumulative Return After Crash'].iloc[-1],ACNaft['Cumulative Return After Crash'].iloc[-1],ADBEaft['Cumulative Return After Crash'].iloc[-1],AMDaft['Cumulative Return After Crash'].iloc[-1],AKAMaft['Cumulative Return After Crash'].iloc[-1],ADSaft['Cumulative Return After Crash'].iloc[-1],APHaft['Cumulative Return After Crash'].iloc[-1],ADIaft['Cumulative Return After Crash'].iloc[-1],ANSSaft['Cumulative Return After Crash'].iloc[-1],AAPLaft['Cumulative Return After Crash'].iloc[-1],AMATaft['Cumulative Return After Crash'].iloc[-1],ANETaft['Cumulative Return After Crash'].iloc[-1],ADSKaft['Cumulative Return After Crash'].iloc[-1],ADPaft['Cumulative Return After Crash'].iloc[-1],AVGOaft['Cumulative Return After Crash'].iloc[-1],BRaft['Cumulative Return After Crash'].iloc[-1],CDNSaft['Cumulative Return After Crash'].iloc[-1],CDWaft['Cumulative Return After Crash'].iloc[-1],CSCOaft['Cumulative Return After Crash'].iloc[-1],CTXSaft['Cumulative Return After Crash'].iloc[-1],CTSHaft['Cumulative Return After Crash'].iloc[-1],GLWaft['Cumulative Return After Crash'].iloc[-1],DXCaft['Cumulative Return After Crash'].iloc[-1],FFIVaft['Cumulative Return After Crash'].iloc[-1],FISaft['Cumulative Return After Crash'].iloc[-1],FISVaft['Cumulative Return After Crash'].iloc[-1],FLTaft['Cumulative Return After Crash'].iloc[-1],FLIRaft['Cumulative Return After Crash'].iloc[-1],FTNTaft['Cumulative Return After Crash'].iloc[-1],ITaft['Cumulative Return After Crash'].iloc[-1],GPNaft['Cumulative Return After Crash'].iloc[-1],HPEaft['Cumulative Return After Crash'].iloc[-1],HPQaft['Cumulative Return After Crash'].iloc[-1],INTCaft['Cumulative Return After Crash'].iloc[-1],IBMaft['Cumulative Return After Crash'].iloc[-1],INTUaft['Cumulative Return After Crash'].iloc[-1],IPGPaft['Cumulative Return After Crash'].iloc[-1],JKHYaft['Cumulative Return After Crash'].iloc[-1],JNPRaft['Cumulative Return After Crash'].iloc[-1],KEYSaft['Cumulative Return After Crash'].iloc[-1],KLACaft['Cumulative Return After Crash'].iloc[-1],LRCXaft['Cumulative Return After Crash'].iloc[-1],LDOSaft['Cumulative Return After Crash'].iloc[-1],MAaft['Cumulative Return After Crash'].iloc[-1],MXIMaft['Cumulative Return After Crash'].iloc[-1],MCHPaft['Cumulative Return After Crash'].iloc[-1],MUaft['Cumulative Return After Crash'].iloc[-1],MSFTaft['Cumulative Return After Crash'].iloc[-1],MSIaft['Cumulative Return After Crash'].iloc[-1],NTAPaft['Cumulative Return After Crash'].iloc[-1],NLOKaft['Cumulative Return After Crash'].iloc[-1],NVDAaft['Cumulative Return After Crash'].iloc[-1],ORCLaft['Cumulative Return After Crash'].iloc[-1],PAYXaft['Cumulative Return After Crash'].iloc[-1],PAYCaft['Cumulative Return After Crash'].iloc[-1],PYPLaft['Cumulative Return After Crash'].iloc[-1],QRVOaft['Cumulative Return After Crash'].iloc[-1],QCOMaft['Cumulative Return After Crash'].iloc[-1],CRMaft['Cumulative Return After Crash'].iloc[-1],STXaft['Cumulative Return After Crash'].iloc[-1],NOWaft['Cumulative Return After Crash'].iloc[-1],SWKSaft['Cumulative Return After Crash'].iloc[-1],SNPSaft['Cumulative Return After Crash'].iloc[-1],TELaft['Cumulative Return After Crash'].iloc[-1],TXNaft['Cumulative Return After Crash'].iloc[-1],VRSNaft['Cumulative Return After Crash'].iloc[-1],Vaft['Cumulative Return After Crash'].iloc[-1],WDCaft['Cumulative Return After Crash'].iloc[-1],WUaft['Cumulative Return After Crash'].iloc[-1],XRXaft['Cumulative Return After Crash'].iloc[-1],XLNXaft['Cumulative Return After Crash'].iloc[-1],ZBRAaft['Cumulative Return After Crash'].iloc[-1]]}
itdf2 = pd.DataFrame(cumret, columns = ['Cumulative Returns 12/4-6/5', 'Cumulative Returns 12/4-2/20', 'Cumulative Returns 2/20-3/23', 'Cumulative Returns 3/23-6/5'], index= ['S&P 500','ACN','ADBE','AMD','AKAM','ADS','APH','ADI','ANSS','AAPL','AMAT','ANET','ADSK','ADP','AVGO','BR','CDNS','CDW','CSCO','CTXS','CTSH','GLW','DXC','FFIV','FIS','FISV','FLT','FLIR','FTNT','IT','GPN','HPE','HPQ','INTC','IBM','INTU','IPGP','JKHY','JNPR','KEYS','KLAC','LRCX','LDOS','MA','MXIM','MCHP','MU','MSFT','MSI','NTAP','NLOK','NVDA','ORCL','PAYX','PAYC','PYPL','QRVO','QCOM','CRM','STX','NOW','SWKS','SNPS','TEL','TXN','VRSN','V','WDC','URI','XRX','XLNX','ZBRA'])
pd.DataFrame(itdf2)
itdf2.sort_values('Cumulative Returns 3/23-6/5', ascending=False)
#Table of Key Statistics of Information Technology Stocks
import pandas as pd
import statistics as stats
itmeans = [ACNmean,ADBEmean,AMDmean,AKAMmean,ADSmean,APHmean,ADImean,ANSSmean,AAPLmean,AMATmean,ANETmean,ADSKmean,ADPmean,AVGOmean,BRmean,CDNSmean,CDWmean,CSCOmean,CTXSmean,CTSHmean,GLWmean,DXCmean,FFIVmean,FISmean,FISVmean,FLTmean,FLIRmean,FTNTmean,ITmean,GPNmean,HPEmean,HPQmean,INTCmean,IBMmean,INTUmean,IPGPmean,JKHYmean,JNPRmean,KEYSmean,KLACmean,LRCXmean,LDOSmean,MAmean,MXIMmean,MCHPmean,MUmean,MSFTmean,MSImean,NTAPmean,NLOKmean,NVDAmean,ORCLmean,PAYXmean,PAYCmean,PYPLmean,QRVOmean,QCOMmean,CRMmean,STXmean,NOWmean,SWKSmean,SNPSmean,TELmean,TXNmean,VRSNmean,Vmean,WDCmean,WUmean,XRXmean,XLNXmean,ZBRAmean]
itaveragemean = stats.mean(itmeans)
itvariances = [ACNvar,ADBEvar,AMDvar,AKAMvar,ADSvar,APHvar,ADIvar,ANSSvar,AAPLvar,AMATvar,ANETvar,ADSKvar,ADPvar,AVGOvar,BRvar,CDNSvar,CDWvar,CSCOvar,CTXSvar,CTSHvar,GLWvar,DXCvar,FFIVvar,FISvar,FISVvar,FLTvar,FLIRvar,FTNTvar,ITvar,GPNvar,HPEvar,HPQvar,INTCvar,IBMvar,INTUvar,IPGPvar,JKHYvar,JNPRvar,KEYSvar,KLACvar,LRCXvar,LDOSvar,MAvar,MXIMvar,MCHPvar,MUvar,MSFTvar,MSIvar,NTAPvar,NLOKvar,NVDAvar,ORCLvar,PAYXvar,PAYCvar,PYPLvar,QRVOvar,QCOMvar,CRMvar,STXvar,NOWvar,SWKSvar,SNPSvar,TELvar,TXNvar,VRSNvar,Vvar,WDCvar,WUvar,XRXvar,XLNXvar,ZBRAvar]
itaveragevar = stats.mean(itvariances)
itkurtoses = [ACNkurt,ADBEkurt,AMDkurt,AKAMkurt,ADSkurt,APHkurt,ADIkurt,ANSSkurt,AAPLkurt,AMATkurt,ANETkurt,ADSKkurt,ADPkurt,AVGOkurt,BRkurt,CDNSkurt,CDWkurt,CSCOkurt,CTXSkurt,CTSHkurt,GLWkurt,DXCkurt,FFIVkurt,FISkurt,FISVkurt,FLTkurt,FLIRkurt,FTNTkurt,ITkurt,GPNkurt,HPEkurt,HPQkurt,INTCkurt,IBMkurt,INTUkurt,IPGPkurt,JKHYkurt,JNPRkurt,KEYSkurt,KLACkurt,LRCXkurt,LDOSkurt,MAkurt,MXIMkurt,MCHPkurt,MUkurt,MSFTkurt,MSIkurt,NTAPkurt,NLOKkurt,NVDAkurt,ORCLkurt,PAYXkurt,PAYCkurt,PYPLkurt,QRVOkurt,QCOMkurt,CRMkurt,STXkurt,NOWkurt,SWKSkurt,SNPSkurt,TELkurt,TXNkurt,VRSNkurt,Vkurt,WDCkurt,WUkurt,XRXkurt,XLNXkurt,ZBRAkurt]
itaveragekurt = stats.mean(itkurtoses)
itskews = [ACNskew,ADBEskew,AMDskew,AKAMskew,ADSskew,APHskew,ADIskew,ANSSskew,AAPLskew,AMATskew,ANETskew,ADSKskew,ADPskew,AVGOskew,BRskew,CDNSskew,CDWskew,CSCOskew,CTXSskew,CTSHskew,GLWskew,DXCskew,FFIVskew,FISskew,FISVskew,FLTskew,FLIRskew,FTNTskew,ITskew,GPNskew,HPEskew,HPQskew,INTCskew,IBMskew,INTUskew,IPGPskew,JKHYskew,JNPRskew,KEYSskew,KLACskew,LRCXskew,LDOSskew,MAskew,MXIMskew,MCHPskew,MUskew,MSFTskew,MSIskew,NTAPskew,NLOKskew,NVDAskew,ORCLskew,PAYXskew,PAYCskew,PYPLskew,QRVOskew,QCOMskew,CRMskew,STXskew,NOWskew,SWKSskew,SNPSskew,TELskew,TXNskew,VRSNskew,Vskew,WDCskew,WUskew,XRXskew,XLNXskew,ZBRAskew]
itaverageskew = stats.mean(itskews)
Information_Technology = {'Mean': [[spmean],[itaveragemean],[ACNmean], [ADBEmean],[AMDmean],[AKAMmean],[ADSmean],[APHmean],[ADImean],[ANSSmean],[AAPLmean],[AMATmean],[ANETmean],[ADSKmean],[ADPmean],[AVGOmean],[BRmean],[CDNSmean],[CDWmean],[CSCOmean],[CTXSmean],[CTSHmean],[GLWmean],[DXCmean],[FFIVmean],[FISmean],[FISVmean],[FLTmean],[FLIRmean],[FTNTmean], [ITmean],[GPNmean],[HPEmean],[HPQmean],[INTCmean],[IBMmean],[INTUmean],[IPGPmean],[JKHYmean],[JNPRmean],[KEYSmean],[KLACmean],[LRCXmean],[LDOSmean],[MAmean],[MXIMmean],[MCHPmean],[MUmean],[MSFTmean],[MSImean],[NTAPmean],[NLOKmean],[NVDAmean],[ORCLmean],[PAYXmean],[PAYCmean],[PYPLmean],[QRVOmean],[QCOMmean],[CRMmean],[STXmean],[NOWmean],[SWKSmean],[SNPSmean],[TELmean],[TXNmean],[VRSNmean],[Vmean],[WDCmean],[WUmean],[XRXmean],[XLNXmean],[ZBRAmean]],
'Variance': [[spvar],[itaveragevar],[ACNvar],[ADBEvar],[AMDvar],[AKAMvar],[ADSvar],[APHvar],[ADIvar],[ANSSvar],[AAPLvar],[AMATvar],[ANETvar],[ADSKvar],[ADPvar],[AVGOvar],[BRvar],[CDNSvar],[CDWvar],[CSCOvar],[CTXSvar],[CTSHvar],[GLWvar],[DXCvar],[FFIVvar],[FISvar],[FISVvar],[FLTvar],[FLIRvar],[FTNTvar],[ITvar],[GPNvar],[HPEvar],[HPQvar],[INTCvar],[IBMvar],[INTUvar],[IPGPvar],[JKHYvar],[JNPRvar],[KEYSvar],[KLACvar],[LRCXvar],[LDOSvar],[MAvar],[MXIMvar],[MCHPvar],[MUvar],[MSFTvar],[MSIvar],[NTAPvar],[NLOKvar],[NVDAvar],[ORCLvar],[PAYXvar],[PAYCvar],[PYPLvar],[QRVOvar],[QCOMvar],[CRMvar],[STXvar],[NOWvar],[SWKSvar],[SNPSvar],[TELvar],[TXNvar],[VRSNvar],[Vvar],[WDCvar],[WUvar],[XRXvar],[XLNXvar],[ZBRAvar]],
'Kurtosis': [[spkurt],[itaveragekurt],[ACNkurt],[ADBEkurt],[AMDkurt],[AKAMkurt],[ADSkurt],[APHkurt],[ADIkurt],[ANSSkurt],[AAPLkurt],[AMATkurt],[ANETkurt],[ADSKkurt],[ADPkurt],[AVGOkurt],[BRkurt],[CDNSkurt],[CDWkurt],[CSCOkurt],[CTXSkurt],[CTSHkurt],[GLWkurt],[DXCkurt],[FFIVkurt],[FISkurt],[FISVkurt],[FLTkurt],[FLIRkurt],[FTNTkurt],[ITkurt],[GPNkurt],[HPEkurt],[HPQkurt],[INTCkurt],[IBMkurt],[INTUkurt],[IPGPkurt],[JKHYkurt],[JNPRkurt],[KEYSkurt],[KLACkurt],[LRCXkurt],[LDOSkurt],[MAkurt],[MXIMkurt],[MCHPkurt],[MUkurt],[MSFTkurt],[MSIkurt],[NTAPkurt],[NLOKkurt],[NVDAkurt],[ORCLkurt],[PAYXkurt],[PAYCkurt],[PYPLkurt],[QRVOkurt],[QCOMkurt],[CRMkurt],[STXkurt],[NOWkurt],[SWKSkurt],[SNPSkurt],[TELkurt],[TXNkurt],[VRSNkurt],[Vkurt],[WDCkurt],[WUkurt],[XRXkurt],[XLNXkurt],[ZBRAkurt]],
'Skew': [[spskew],[itaverageskew],[ACNskew],[ADBEskew],[AMDskew],[AKAMskew],[ADSskew],[APHskew],[ADIskew],[ANSSskew],[AAPLskew],[AMATskew],[ANETskew],[ADSKskew],[ADPskew],[AVGOskew],[BRskew],[CDNSskew],[CDWskew],[CSCOskew],[CTXSskew],[CTSHskew],[GLWskew],[DXCskew],[FFIVskew],[FISskew],[FISVskew],[FLTskew],[FLIRskew],[FTNTskew],[ITskew],[GPNskew],[HPEskew],[HPQskew],[INTCskew],[IBMskew],[INTUskew],[IPGPskew],[JKHYskew],[JNPRskew],[KEYSskew],[KLACskew],[LRCXskew],[LDOSskew],[MAskew],[MXIMskew],[MCHPskew],[MUskew],[MSFTskew],[MSIskew],[NTAPskew],[NLOKskew],[NVDAskew],[ORCLskew],[PAYXskew],[PAYCskew],[PYPLskew],[QRVOskew],[QCOMskew],[CRMskew],[STXskew],[NOWskew],[SWKSskew],[SNPSskew],[TELskew],[TXNskew],[VRSNskew],[Vskew],[WDCskew],[WUskew],[XRXskew],[XLNXskew],[ZBRAskew]],
}
itdf = pd.DataFrame(Information_Technology, columns = ['Mean', 'Variance', 'Kurtosis', 'Skew'], index= ['S&P 500','Average','ACN','ADBE','AMD','AKAM','ADS','APH','ADI','ANSS','AAPL','AMAT','ANET','ADSK','ADP','AVGO','BR','CDNS','CDW','CSCO','CTXS','CTSH','GLW','DXC','FFIV','FIS','FISV','FLT','FLIR','FTNT','IT','GPN','HPE','HPQ','INTC','IBM','INTU','IPGP','JKHY','JNPR','KEYS','KLAC','LRCX','LDOS','MA','MXIM','MCHP','MU','MSFT','MSI','NTAP','NLOK','NVDA','ORCL','PAYX','PAYC','PYPL','QRVO','QCOM','CRM','STX','NOW','SWKS','SNPS','TEL','TXN','VRSN','V','WDC','WU','XRX','XLNX','ZBRA']
)
pd.DataFrame(itdf)
itdf.sort_values("Mean", ascending=False)
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ATVI = web.DataReader('ATVI', 'yahoo', start, end)
ATVI['returns'] = ATVI['Close'].pct_change(1)
ATVI['Cumulative Return'] = (1 + ATVI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ATVImean = ATVI['returns'].mean()
ATVIvar = ATVI['returns'].var()
ATVIkurt = ATVI['returns'].kurt()
ATVIskew = ATVI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ATVIbef = web.DataReader('ATVI', 'yahoo', start, crashstart)
ATVIbef['avgreturnbefore'] = ATVIbef['Close'].pct_change(1)
ATVIbef['Cumulative Return Before Crash'] = (1 + ATVIbef['avgreturnbefore']).cumprod()
#period of crash
ATVIdur = web.DataReader('ATVI', 'yahoo', crashstart, crashend)
ATVIdur['avgreturnduring'] = ATVIdur['Close'].pct_change(1)
ATVIdur['Cumulative Return During Crash'] = (1 + ATVIdur['avgreturnduring']).cumprod()
#period after crash
ATVIaft = web.DataReader('ATVI', 'yahoo', crashend, end)
ATVIaft['avgreturnafter'] = ATVIaft['Close'].pct_change(1)
ATVIaft['Cumulative Return After Crash'] = (1 + ATVIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GOOGL = web.DataReader('GOOGL', 'yahoo', start, end)
GOOGL['returns'] = GOOGL['Close'].pct_change(1)
GOOGL['Cumulative Return'] = (1 + GOOGL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GOOGLmean = GOOGL['returns'].mean()
GOOGLvar = GOOGL['returns'].var()
GOOGLkurt = GOOGL['returns'].kurt()
GOOGLskew = GOOGL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GOOGLbef = web.DataReader('GOOGL', 'yahoo', start, crashstart)
GOOGLbef['avgreturnbefore'] = GOOGLbef['Close'].pct_change(1)
GOOGLbef['Cumulative Return Before Crash'] = (1 + GOOGLbef['avgreturnbefore']).cumprod()
#period of crash
GOOGLdur = web.DataReader('GOOGL', 'yahoo', crashstart, crashend)
GOOGLdur['avgreturnduring'] = GOOGLdur['Close'].pct_change(1)
GOOGLdur['Cumulative Return During Crash'] = (1 + GOOGLdur['avgreturnduring']).cumprod()
#period after crash
GOOGLaft = web.DataReader('GOOGL', 'yahoo', crashend, end)
GOOGLaft['avgreturnafter'] = GOOGLaft['Close'].pct_change(1)
GOOGLaft['Cumulative Return After Crash'] = (1 + GOOGLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
GOOG = web.DataReader('GOOG', 'yahoo', start, end)
GOOG['returns'] = GOOG['Close'].pct_change(1)
GOOG['Cumulative Return'] = (1 + GOOG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
GOOGmean = GOOG['returns'].mean()
GOOGvar = GOOG['returns'].var()
GOOGkurt = GOOG['returns'].kurt()
GOOGskew = GOOG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
GOOGbef = web.DataReader('GOOG', 'yahoo', start, crashstart)
GOOGbef['avgreturnbefore'] = GOOGbef['Close'].pct_change(1)
GOOGbef['Cumulative Return Before Crash'] = (1 + GOOGbef['avgreturnbefore']).cumprod()
#period of crash
GOOGdur = web.DataReader('GOOG', 'yahoo', crashstart, crashend)
GOOGdur['avgreturnduring'] = GOOGdur['Close'].pct_change(1)
GOOGdur['Cumulative Return During Crash'] = (1 + GOOGdur['avgreturnduring']).cumprod()
#period after crash
GOOGaft = web.DataReader('GOOG', 'yahoo', crashend, end)
GOOGaft['avgreturnafter'] = GOOGaft['Close'].pct_change(1)
GOOGaft['Cumulative Return After Crash'] = (1 + GOOGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
T = web.DataReader('T', 'yahoo', start, end)
T['returns'] = T['Close'].pct_change(1)
T['Cumulative Return'] = (1 + T['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
Tmean = T['returns'].mean()
Tvar = T['returns'].var()
Tkurt = T['returns'].kurt()
Tskew = T['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
Tbef = web.DataReader('T', 'yahoo', start, crashstart)
Tbef['avgreturnbefore'] = Tbef['Close'].pct_change(1)
Tbef['Cumulative Return Before Crash'] = (1 + Tbef['avgreturnbefore']).cumprod()
#period of crash
Tdur = web.DataReader('T', 'yahoo', crashstart, crashend)
Tdur['avgreturnduring'] = Tdur['Close'].pct_change(1)
Tdur['Cumulative Return During Crash'] = (1 + Tdur['avgreturnduring']).cumprod()
#period after crash
Taft = web.DataReader('T', 'yahoo', crashend, end)
Taft['avgreturnafter'] = Taft['Close'].pct_change(1)
Taft['Cumulative Return After Crash'] = (1 + Taft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CTL = web.DataReader('CTL', 'yahoo', start, end)
CTL['returns'] = CTL['Close'].pct_change(1)
CTL['Cumulative Return'] = (1 + CTL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CTLmean = CTL['returns'].mean()
CTLvar = CTL['returns'].var()
CTLkurt = CTL['returns'].kurt()
CTLskew = CTL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CTLbef = web.DataReader('CTL', 'yahoo', start, crashstart)
CTLbef['avgreturnbefore'] = CTLbef['Close'].pct_change(1)
CTLbef['Cumulative Return Before Crash'] = (1 + CTLbef['avgreturnbefore']).cumprod()
#period of crash
CTLdur = web.DataReader('CTL', 'yahoo', crashstart, crashend)
CTLdur['avgreturnduring'] = CTLdur['Close'].pct_change(1)
CTLdur['Cumulative Return During Crash'] = (1 + CTLdur['avgreturnduring']).cumprod()
#period after crash
CTLaft = web.DataReader('CTL', 'yahoo', crashend, end)
CTLaft['avgreturnafter'] = CTLaft['Close'].pct_change(1)
CTLaft['Cumulative Return After Crash'] = (1 + CTLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CHTR = web.DataReader('CHTR', 'yahoo', start, end)
CHTR['returns'] = CHTR['Close'].pct_change(1)
CHTR['Cumulative Return'] = (1 + CHTR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CHTRmean = CHTR['returns'].mean()
CHTRvar = CHTR['returns'].var()
CHTRkurt = CHTR['returns'].kurt()
CHTRskew = CHTR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CHTRbef = web.DataReader('CHTR', 'yahoo', start, crashstart)
CHTRbef['avgreturnbefore'] = CHTRbef['Close'].pct_change(1)
CHTRbef['Cumulative Return Before Crash'] = (1 + CHTRbef['avgreturnbefore']).cumprod()
#period of crash
CHTRdur = web.DataReader('CHTR', 'yahoo', crashstart, crashend)
CHTRdur['avgreturnduring'] = CHTRdur['Close'].pct_change(1)
CHTRdur['Cumulative Return During Crash'] = (1 + CHTRdur['avgreturnduring']).cumprod()
#period after crash
CHTRaft = web.DataReader('CHTR', 'yahoo', crashend, end)
CHTRaft['avgreturnafter'] = CHTRaft['Close'].pct_change(1)
CHTRaft['Cumulative Return After Crash'] = (1 + CHTRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CMCSA = web.DataReader('CMCSA', 'yahoo', start, end)
CMCSA['returns'] = CMCSA['Close'].pct_change(1)
CMCSA['Cumulative Return'] = (1 + CMCSA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CMCSAmean = CMCSA['returns'].mean()
CMCSAvar = CMCSA['returns'].var()
CMCSAkurt = CMCSA['returns'].kurt()
CMCSAskew = CMCSA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CMCSAbef = web.DataReader('CMCSA', 'yahoo', start, crashstart)
CMCSAbef['avgreturnbefore'] = CMCSAbef['Close'].pct_change(1)
CMCSAbef['Cumulative Return Before Crash'] = (1 + CMCSAbef['avgreturnbefore']).cumprod()
#period of crash
CMCSAdur = web.DataReader('CMCSA', 'yahoo', crashstart, crashend)
CMCSAdur['avgreturnduring'] = CMCSAdur['Close'].pct_change(1)
CMCSAdur['Cumulative Return During Crash'] = (1 + CMCSAdur['avgreturnduring']).cumprod()
#period after crash
CMCSAaft = web.DataReader('CMCSA', 'yahoo', crashend, end)
CMCSAaft['avgreturnafter'] = CMCSAaft['Close'].pct_change(1)
CMCSAaft['Cumulative Return After Crash'] = (1 + CMCSAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DISCA = web.DataReader('DISCA', 'yahoo', start, end)
DISCA['returns'] = DISCA['Close'].pct_change(1)
DISCA['Cumulative Return'] = (1 + DISCA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DISCAmean = DISCA['returns'].mean()
DISCAvar = DISCA['returns'].var()
DISCAkurt = DISCA['returns'].kurt()
DISCAskew = DISCA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DISCAbef = web.DataReader('DISCA', 'yahoo', start, crashstart)
DISCAbef['avgreturnbefore'] = DISCAbef['Close'].pct_change(1)
DISCAbef['Cumulative Return Before Crash'] = (1 + DISCAbef['avgreturnbefore']).cumprod()
#period of crash
DISCAdur = web.DataReader('DISCA', 'yahoo', crashstart, crashend)
DISCAdur['avgreturnduring'] = DISCAdur['Close'].pct_change(1)
DISCAdur['Cumulative Return During Crash'] = (1 + DISCAdur['avgreturnduring']).cumprod()
#period after crash
DISCAaft = web.DataReader('DISCA', 'yahoo', crashend, end)
DISCAaft['avgreturnafter'] = DISCAaft['Close'].pct_change(1)
DISCAaft['Cumulative Return After Crash'] = (1 + DISCAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DISCK = web.DataReader('DISCK', 'yahoo', start, end)
DISCK['returns'] = DISCK['Close'].pct_change(1)
DISCK['Cumulative Return'] = (1 + DISCK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DISCKmean = DISCK['returns'].mean()
DISCKvar = DISCK['returns'].var()
DISCKkurt = DISCK['returns'].kurt()
DISCKskew = DISCK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DISCKbef = web.DataReader('DISCK', 'yahoo', start, crashstart)
DISCKbef['avgreturnbefore'] = DISCKbef['Close'].pct_change(1)
DISCKbef['Cumulative Return Before Crash'] = (1 + DISCKbef['avgreturnbefore']).cumprod()
#period of crash
DISCKdur = web.DataReader('DISCK', 'yahoo', crashstart, crashend)
DISCKdur['avgreturnduring'] = DISCKdur['Close'].pct_change(1)
DISCKdur['Cumulative Return During Crash'] = (1 + DISCKdur['avgreturnduring']).cumprod()
#period after crash
DISCKaft = web.DataReader('DISCK', 'yahoo', crashend, end)
DISCKaft['avgreturnafter'] = DISCKaft['Close'].pct_change(1)
DISCKaft['Cumulative Return After Crash'] = (1 + DISCKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DISH = web.DataReader('DISH', 'yahoo', start, end)
DISH['returns'] = DISH['Close'].pct_change(1)
DISH['Cumulative Return'] = (1 + DISH['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DISHmean = DISH['returns'].mean()
DISHvar = DISH['returns'].var()
DISHkurt = DISH['returns'].kurt()
DISHskew = DISH['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DISHbef = web.DataReader('DISH', 'yahoo', start, crashstart)
DISHbef['avgreturnbefore'] = DISHbef['Close'].pct_change(1)
DISHbef['Cumulative Return Before Crash'] = (1 + DISHbef['avgreturnbefore']).cumprod()
#period of crash
DISHdur = web.DataReader('DISH', 'yahoo', crashstart, crashend)
DISHdur['avgreturnduring'] = DISHdur['Close'].pct_change(1)
DISHdur['Cumulative Return During Crash'] = (1 + DISHdur['avgreturnduring']).cumprod()
#period after crash
DISHaft = web.DataReader('DISH', 'yahoo', crashend, end)
DISHaft['avgreturnafter'] = DISHaft['Close'].pct_change(1)
DISHaft['Cumulative Return After Crash'] = (1 + DISHaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EA = web.DataReader('EA', 'yahoo', start, end)
EA['returns'] = EA['Close'].pct_change(1)
EA['Cumulative Return'] = (1 + EA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EAmean = EA['returns'].mean()
EAvar = EA['returns'].var()
EAkurt = EA['returns'].kurt()
EAskew = EA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EAbef = web.DataReader('EA', 'yahoo', start, crashstart)
EAbef['avgreturnbefore'] = EAbef['Close'].pct_change(1)
EAbef['Cumulative Return Before Crash'] = (1 + EAbef['avgreturnbefore']).cumprod()
#period of crash
EAdur = web.DataReader('EA', 'yahoo', crashstart, crashend)
EAdur['avgreturnduring'] = EAdur['Close'].pct_change(1)
EAdur['Cumulative Return During Crash'] = (1 + EAdur['avgreturnduring']).cumprod()
#period after crash
EAaft = web.DataReader('EA', 'yahoo', crashend, end)
EAaft['avgreturnafter'] = EAaft['Close'].pct_change(1)
EAaft['Cumulative Return After Crash'] = (1 + EAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FB = web.DataReader('FB', 'yahoo', start, end)
FB['returns'] = FB['Close'].pct_change(1)
FB['Cumulative Return'] = (1 + FB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FBmean = FB['returns'].mean()
FBvar = FB['returns'].var()
FBkurt = FB['returns'].kurt()
FBskew = FB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FBbef = web.DataReader('FB', 'yahoo', start, crashstart)
FBbef['avgreturnbefore'] = FBbef['Close'].pct_change(1)
FBbef['Cumulative Return Before Crash'] = (1 + FBbef['avgreturnbefore']).cumprod()
#period of crash
FBdur = web.DataReader('FB', 'yahoo', crashstart, crashend)
FBdur['avgreturnduring'] = FBdur['Close'].pct_change(1)
FBdur['Cumulative Return During Crash'] = (1 + FBdur['avgreturnduring']).cumprod()
#period after crash
FBaft = web.DataReader('FB', 'yahoo', crashend, end)
FBaft['avgreturnafter'] = FBaft['Close'].pct_change(1)
FBaft['Cumulative Return After Crash'] = (1 + FBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FOXA = web.DataReader('FOXA', 'yahoo', start, end)
FOXA['returns'] = FOXA['Close'].pct_change(1)
FOXA['Cumulative Return'] = (1 + FOXA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FOXAmean = FOXA['returns'].mean()
FOXAvar = FOXA['returns'].var()
FOXAkurt = FOXA['returns'].kurt()
FOXAskew = FOXA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FOXAbef = web.DataReader('FOXA', 'yahoo', start, crashstart)
FOXAbef['avgreturnbefore'] = FOXAbef['Close'].pct_change(1)
FOXAbef['Cumulative Return Before Crash'] = (1 + FOXAbef['avgreturnbefore']).cumprod()
#period of crash
FOXAdur = web.DataReader('FOXA', 'yahoo', crashstart, crashend)
FOXAdur['avgreturnduring'] = FOXAdur['Close'].pct_change(1)
FOXAdur['Cumulative Return During Crash'] = (1 + FOXAdur['avgreturnduring']).cumprod()
#period after crash
FOXAaft = web.DataReader('FOXA', 'yahoo', crashend, end)
FOXAaft['avgreturnafter'] = FOXAaft['Close'].pct_change(1)
FOXAaft['Cumulative Return After Crash'] = (1 + FOXAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FOX = web.DataReader('FOX', 'yahoo', start, end)
FOX['returns'] = FOX['Close'].pct_change(1)
FOX['Cumulative Return'] = (1 + FOX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FOXmean = FOX['returns'].mean()
FOXvar = FOX['returns'].var()
FOXkurt = FOX['returns'].kurt()
FOXskew = FOX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FOXbef = web.DataReader('FOX', 'yahoo', start, crashstart)
FOXbef['avgreturnbefore'] = FOXbef['Close'].pct_change(1)
FOXbef['Cumulative Return Before Crash'] = (1 + FOXbef['avgreturnbefore']).cumprod()
#period of crash
FOXdur = web.DataReader('FOX', 'yahoo', crashstart, crashend)
FOXdur['avgreturnduring'] = FOXdur['Close'].pct_change(1)
FOXdur['Cumulative Return During Crash'] = (1 + FOXdur['avgreturnduring']).cumprod()
#period after crash
FOXaft = web.DataReader('FOX', 'yahoo', crashend, end)
FOXaft['avgreturnafter'] = FOXaft['Close'].pct_change(1)
FOXaft['Cumulative Return After Crash'] = (1 + FOXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
IPG = web.DataReader('IPG', 'yahoo', start, end)
IPG['returns'] = IPG['Close'].pct_change(1)
IPG['Cumulative Return'] = (1 + IPG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
IPGmean = IPG['returns'].mean()
IPGvar = IPG['returns'].var()
IPGkurt = IPG['returns'].kurt()
IPGskew = IPG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
IPGbef = web.DataReader('IPG', 'yahoo', start, crashstart)
IPGbef['avgreturnbefore'] = IPGbef['Close'].pct_change(1)
IPGbef['Cumulative Return Before Crash'] = (1 + IPGbef['avgreturnbefore']).cumprod()
#period of crash
IPGdur = web.DataReader('IPG', 'yahoo', crashstart, crashend)
IPGdur['avgreturnduring'] = IPGdur['Close'].pct_change(1)
IPGdur['Cumulative Return During Crash'] = (1 + IPGdur['avgreturnduring']).cumprod()
#period after crash
IPGaft = web.DataReader('IPG', 'yahoo', crashend, end)
IPGaft['avgreturnafter'] = IPGaft['Close'].pct_change(1)
IPGaft['Cumulative Return After Crash'] = (1 + IPGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LYV = web.DataReader('LYV', 'yahoo', start, end)
LYV['returns'] = LYV['Close'].pct_change(1)
LYV['Cumulative Return'] = (1 + LYV['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LYVmean = LYV['returns'].mean()
LYVvar = LYV['returns'].var()
LYVkurt = LYV['returns'].kurt()
LYVskew = LYV['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LYVbef = web.DataReader('LYV', 'yahoo', start, crashstart)
LYVbef['avgreturnbefore'] = LYVbef['Close'].pct_change(1)
LYVbef['Cumulative Return Before Crash'] = (1 + LYVbef['avgreturnbefore']).cumprod()
#period of crash
LYVdur = web.DataReader('LYV', 'yahoo', crashstart, crashend)
LYVdur['avgreturnduring'] = LYVdur['Close'].pct_change(1)
LYVdur['Cumulative Return During Crash'] = (1 + LYVdur['avgreturnduring']).cumprod()
#period after crash
LYVaft = web.DataReader('LYV', 'yahoo', crashend, end)
LYVaft['avgreturnafter'] = LYVaft['Close'].pct_change(1)
LYVaft['Cumulative Return After Crash'] = (1 + LYVaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NFLX = web.DataReader('NFLX', 'yahoo', start, end)
NFLX['returns'] = NFLX['Close'].pct_change(1)
NFLX['Cumulative Return'] = (1 + NFLX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NFLXmean = NFLX['returns'].mean()
NFLXvar = NFLX['returns'].var()
NFLXkurt = NFLX['returns'].kurt()
NFLXskew = NFLX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NFLXbef = web.DataReader('NFLX', 'yahoo', start, crashstart)
NFLXbef['avgreturnbefore'] = NFLXbef['Close'].pct_change(1)
NFLXbef['Cumulative Return Before Crash'] = (1 + NFLXbef['avgreturnbefore']).cumprod()
#period of crash
NFLXdur = web.DataReader('NFLX', 'yahoo', crashstart, crashend)
NFLXdur['avgreturnduring'] = NFLXdur['Close'].pct_change(1)
NFLXdur['Cumulative Return During Crash'] = (1 + NFLXdur['avgreturnduring']).cumprod()
#period after crash
NFLXaft = web.DataReader('NFLX', 'yahoo', crashend, end)
NFLXaft['avgreturnafter'] = NFLXaft['Close'].pct_change(1)
NFLXaft['Cumulative Return After Crash'] = (1 + NFLXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NWSA = web.DataReader('NWSA', 'yahoo', start, end)
NWSA['returns'] = NWSA['Close'].pct_change(1)
NWSA['Cumulative Return'] = (1 + NWSA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NWSAmean = NWSA['returns'].mean()
NWSAvar = NWSA['returns'].var()
NWSAkurt = NWSA['returns'].kurt()
NWSAskew = NWSA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NWSAbef = web.DataReader('NWSA', 'yahoo', start, crashstart)
NWSAbef['avgreturnbefore'] = NWSAbef['Close'].pct_change(1)
NWSAbef['Cumulative Return Before Crash'] = (1 + NWSAbef['avgreturnbefore']).cumprod()
#period of crash
NWSAdur = web.DataReader('NWSA', 'yahoo', crashstart, crashend)
NWSAdur['avgreturnduring'] = NWSAdur['Close'].pct_change(1)
NWSAdur['Cumulative Return During Crash'] = (1 + NWSAdur['avgreturnduring']).cumprod()
#period after crash
NWSAaft = web.DataReader('NWSA', 'yahoo', crashend, end)
NWSAaft['avgreturnafter'] = NWSAaft['Close'].pct_change(1)
NWSAaft['Cumulative Return After Crash'] = (1 + NWSAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NWS = web.DataReader('NWS', 'yahoo', start, end)
NWS['returns'] = NWS['Close'].pct_change(1)
NWS['Cumulative Return'] = (1 + NWS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NWSmean = NWS['returns'].mean()
NWSvar = NWS['returns'].var()
NWSkurt = NWS['returns'].kurt()
NWSskew = NWS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NWSbef = web.DataReader('NWS', 'yahoo', start, crashstart)
NWSbef['avgreturnbefore'] = NWSbef['Close'].pct_change(1)
NWSbef['Cumulative Return Before Crash'] = (1 + NWSbef['avgreturnbefore']).cumprod()
#period of crash
NWSdur = web.DataReader('NWS', 'yahoo', crashstart, crashend)
NWSdur['avgreturnduring'] = NWSdur['Close'].pct_change(1)
NWSdur['Cumulative Return During Crash'] = (1 + NWSdur['avgreturnduring']).cumprod()
#period after crash
NWSaft = web.DataReader('NWS', 'yahoo', crashend, end)
NWSaft['avgreturnafter'] = NWSaft['Close'].pct_change(1)
NWSaft['Cumulative Return After Crash'] = (1 + NWSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
OMC = web.DataReader('OMC', 'yahoo', start, end)
OMC['returns'] = OMC['Close'].pct_change(1)
OMC['Cumulative Return'] = (1 + OMC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
OMCmean = OMC['returns'].mean()
OMCvar = OMC['returns'].var()
OMCkurt = OMC['returns'].kurt()
OMCskew = OMC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
OMCbef = web.DataReader('OMC', 'yahoo', start, crashstart)
OMCbef['avgreturnbefore'] = OMCbef['Close'].pct_change(1)
OMCbef['Cumulative Return Before Crash'] = (1 + OMCbef['avgreturnbefore']).cumprod()
#period of crash
OMCdur = web.DataReader('OMC', 'yahoo', crashstart, crashend)
OMCdur['avgreturnduring'] = OMCdur['Close'].pct_change(1)
OMCdur['Cumulative Return During Crash'] = (1 + OMCdur['avgreturnduring']).cumprod()
#period after crash
OMCaft = web.DataReader('OMC', 'yahoo', crashend, end)
OMCaft['avgreturnafter'] = OMCaft['Close'].pct_change(1)
OMCaft['Cumulative Return After Crash'] = (1 + OMCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TMUS = web.DataReader('TMUS', 'yahoo', start, end)
TMUS['returns'] = TMUS['Close'].pct_change(1)
TMUS['Cumulative Return'] = (1 + TMUS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TMUSmean = TMUS['returns'].mean()
TMUSvar = TMUS['returns'].var()
TMUSkurt = TMUS['returns'].kurt()
TMUSskew = TMUS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TMUSbef = web.DataReader('TMUS', 'yahoo', start, crashstart)
TMUSbef['avgreturnbefore'] = TMUSbef['Close'].pct_change(1)
TMUSbef['Cumulative Return Before Crash'] = (1 + TMUSbef['avgreturnbefore']).cumprod()
#period of crash
TMUSdur = web.DataReader('TMUS', 'yahoo', crashstart, crashend)
TMUSdur['avgreturnduring'] = TMUSdur['Close'].pct_change(1)
TMUSdur['Cumulative Return During Crash'] = (1 + TMUSdur['avgreturnduring']).cumprod()
#period after crash
TMUSaft = web.DataReader('TMUS', 'yahoo', crashend, end)
TMUSaft['avgreturnafter'] = TMUSaft['Close'].pct_change(1)
TMUSaft['Cumulative Return After Crash'] = (1 + TMUSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TTWO = web.DataReader('TTWO', 'yahoo', start, end)
TTWO['returns'] = TTWO['Close'].pct_change(1)
TTWO['Cumulative Return'] = (1 + TTWO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TTWOmean = TTWO['returns'].mean()
TTWOvar = TTWO['returns'].var()
TTWOkurt = TTWO['returns'].kurt()
TTWOskew = TTWO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TTWObef = web.DataReader('TTWO', 'yahoo', start, crashstart)
TTWObef['avgreturnbefore'] = TTWObef['Close'].pct_change(1)
TTWObef['Cumulative Return Before Crash'] = (1 + TTWObef['avgreturnbefore']).cumprod()
#period of crash
TTWOdur = web.DataReader('TTWO', 'yahoo', crashstart, crashend)
TTWOdur['avgreturnduring'] = TTWOdur['Close'].pct_change(1)
TTWOdur['Cumulative Return During Crash'] = (1 + TTWOdur['avgreturnduring']).cumprod()
#period after crash
TTWOaft = web.DataReader('TTWO', 'yahoo', crashend, end)
TTWOaft['avgreturnafter'] = TTWOaft['Close'].pct_change(1)
TTWOaft['Cumulative Return After Crash'] = (1 + TTWOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
TWTR = web.DataReader('TWTR', 'yahoo', start, end)
TWTR['returns'] = TWTR['Close'].pct_change(1)
TWTR['Cumulative Return'] = (1 + TWTR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
TWTRmean = TWTR['returns'].mean()
TWTRvar = TWTR['returns'].var()
TWTRkurt = TWTR['returns'].kurt()
TWTRskew = TWTR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
TWTRbef = web.DataReader('TWTR', 'yahoo', start, crashstart)
TWTRbef['avgreturnbefore'] = TWTRbef['Close'].pct_change(1)
TWTRbef['Cumulative Return Before Crash'] = (1 + TWTRbef['avgreturnbefore']).cumprod()
#period of crash
TWTRdur = web.DataReader('TWTR', 'yahoo', crashstart, crashend)
TWTRdur['avgreturnduring'] = TWTRdur['Close'].pct_change(1)
TWTRdur['Cumulative Return During Crash'] = (1 + TWTRdur['avgreturnduring']).cumprod()
#period after crash
TWTRaft = web.DataReader('TWTR', 'yahoo', crashend, end)
TWTRaft['avgreturnafter'] = TWTRaft['Close'].pct_change(1)
TWTRaft['Cumulative Return After Crash'] = (1 + TWTRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
VZ = web.DataReader('VZ', 'yahoo', start, end)
VZ['returns'] = VZ['Close'].pct_change(1)
VZ['Cumulative Return'] = (1 + VZ['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
VZmean = VZ['returns'].mean()
VZvar = VZ['returns'].var()
VZkurt = VZ['returns'].kurt()
VZskew = VZ['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
VZbef = web.DataReader('VZ', 'yahoo', start, crashstart)
VZbef['avgreturnbefore'] = VZbef['Close'].pct_change(1)
VZbef['Cumulative Return Before Crash'] = (1 + VZbef['avgreturnbefore']).cumprod()
#period of crash
VZdur = web.DataReader('VZ', 'yahoo', crashstart, crashend)
VZdur['avgreturnduring'] = VZdur['Close'].pct_change(1)
VZdur['Cumulative Return During Crash'] = (1 + VZdur['avgreturnduring']).cumprod()
#period after crash
VZaft = web.DataReader('VZ', 'yahoo', crashend, end)
VZaft['avgreturnafter'] = VZaft['Close'].pct_change(1)
VZaft['Cumulative Return After Crash'] = (1 + VZaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
VIAC = web.DataReader('VIAC', 'yahoo', start, end)
VIAC['returns'] = VIAC['Close'].pct_change(1)
VIAC['Cumulative Return'] = (1 + VIAC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
VIACmean = VIAC['returns'].mean()
VIACvar = VIAC['returns'].var()
VIACkurt = VIAC['returns'].kurt()
VIACskew = VIAC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
VIACbef = web.DataReader('VIAC', 'yahoo', start, crashstart)
VIACbef['avgreturnbefore'] = VIACbef['Close'].pct_change(1)
VIACbef['Cumulative Return Before Crash'] = (1 + VIACbef['avgreturnbefore']).cumprod()
#period of crash
VIACdur = web.DataReader('VIAC', 'yahoo', crashstart, crashend)
VIACdur['avgreturnduring'] = VIACdur['Close'].pct_change(1)
VIACdur['Cumulative Return During Crash'] = (1 + VIACdur['avgreturnduring']).cumprod()
#period after crash
VIACaft = web.DataReader('VIAC', 'yahoo', crashend, end)
VIACaft['avgreturnafter'] = VIACaft['Close'].pct_change(1)
VIACaft['Cumulative Return After Crash'] = (1 + VIACaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DIS = web.DataReader('DIS', 'yahoo', start, end)
DIS['returns'] = DIS['Close'].pct_change(1)
DIS['Cumulative Return'] = (1 + DIS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DISmean = DIS['returns'].mean()
DISvar = DIS['returns'].var()
DISkurt = DIS['returns'].kurt()
DISskew = DIS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DISbef = web.DataReader('DIS', 'yahoo', start, crashstart)
DISbef['avgreturnbefore'] = DISbef['Close'].pct_change(1)
DISbef['Cumulative Return Before Crash'] = (1 + DISbef['avgreturnbefore']).cumprod()
#period of crash
DISdur = web.DataReader('DIS', 'yahoo', crashstart, crashend)
DISdur['avgreturnduring'] = DISdur['Close'].pct_change(1)
DISdur['Cumulative Return During Crash'] = (1 + DISdur['avgreturnduring']).cumprod()
#period after crash
DISaft = web.DataReader('DIS', 'yahoo', crashend, end)
DISaft['avgreturnafter'] = DISaft['Close'].pct_change(1)
DISaft['Cumulative Return After Crash'] = (1 + DISaft['avgreturnafter']).cumprod()
#KDE Plot for Communication Services Sector
sp['returns'].plot(kind = 'kde', label ='S&P 500', alpha=0.5)
ATVI['returns'].plot(kind = 'kde', label ='ATVI', figsize = (10,8), alpha=0.5, title = 'KDE of Communication Services Stocks')
GOOGL['returns'].plot(kind = 'kde', label ='GOOGL', alpha=0.5)
GOOG['returns'].plot(kind = 'kde', label ='GOOG', alpha=0.5)
T['returns'].plot(kind = 'kde', label ='T', alpha=0.5)
CTL['returns'].plot(kind = 'kde', label ='CTL', alpha=0.5)
CHTR['returns'].plot(kind = 'kde', label ='CHTR', alpha=0.5)
CMCSA['returns'].plot(kind = 'kde', label ='CMCSA', alpha=0.5)
DISCA['returns'].plot(kind = 'kde', label ='DISCA', alpha=0.5)
DISCK['returns'].plot(kind = 'kde', label ='DISCK', alpha=0.5)
DISH['returns'].plot(kind = 'kde', label ='DISH', alpha=0.5)
EA['returns'].plot(kind = 'kde', label ='EA', alpha=0.5)
FB['returns'].plot(kind = 'kde', label ='FB', alpha=0.5)
FOXA['returns'].plot(kind = 'kde', label ='FOXA', alpha=0.5)
FOX['returns'].plot(kind = 'kde', label ='FOX', alpha=0.5)
IPG['returns'].plot(kind = 'kde', label = 'IPG', alpha=0.5)
LYV['returns'].plot(kind = 'kde', label ='LYV', alpha=0.5)
NFLX['returns'].plot(kind = 'kde', label ='NFLX', alpha=0.5)
NWSA['returns'].plot(kind = 'kde', label ='NWSA', alpha=0.5)
NWS['returns'].plot(kind = 'kde', label ='NWS', alpha=0.5)
OMC['returns'].plot(kind = 'kde', label ='OMC', alpha=0.5)
TMUS['returns'].plot(kind = 'kde', label ='TMUS', alpha=0.5)
TTWO['returns'].plot(kind = 'kde', label ='TTWO', alpha=0.5)
TWTR['returns'].plot(kind = 'kde', label ='TWTR', alpha=0.5)
VZ['returns'].plot(kind = 'kde', label ='VZ', alpha=0.5)
VIAC['returns'].plot(kind = 'kde', label ='VIAC', alpha=0.5)
DIS['returns'].plot(kind = 'kde', label ='DIS', alpha=0.5)
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Boxplots comparing returns for Communication Services Sector
box_df = pd.concat([sp['returns'],ATVI['returns'],GOOGL['returns'],GOOG['returns'],T['returns'],CTL['returns'],CHTR['returns'],CMCSA['returns'],DISCA['returns'],DISCK['returns'],DISH['returns'],EA['returns'],FB['returns'],FOXA['returns'],FOX['returns'],IPG['returns'],LYV['returns'],NFLX['returns'],NWSA['returns'],NWS['returns'],OMC['returns'],TMUS['returns'],TTWO['returns'],TWTR['returns'],VZ['returns'],VIAC['returns'],DIS['returns']], axis=1)
box_df.columns = ['S&P 500','ATVI','GOOGL','GOOG','T','CTL','CHTR','CMCSA','DISCA','DISCK','DISH','EA','FB','FOXA','FOX','IPG','LYV','NFLX','NWSA','NWS','OMC','TMUS','TTWO','TWTR','VZ','VIAC','DIS']
box_df.plot(kind='box', figsize=(30,10), colormap= 'jet', title = 'Boxplots of Communication Services Sector Returns')
#Cumulative Returns of Communication Services Stocks for Whole period
sp['Cumulative Return'].plot(label="S&P 500")
ATVI['Cumulative Return'].plot(label='ATVI', figsize=(16,8), title = 'Cumulative Return of Communication Services Stocks')
GOOGL['Cumulative Return'].plot(label="GOOGL")
GOOG['Cumulative Return'].plot(label="GOOG")
T['Cumulative Return'].plot(label="T")
CTL['Cumulative Return'].plot(label="CTL")
CHTR['Cumulative Return'].plot(label="CHTR")
CMCSA['Cumulative Return'].plot(label="CMCSA")
DISCA['Cumulative Return'].plot(label="DISCA")
DISCK['Cumulative Return'].plot(label="DISCK")
DISH['Cumulative Return'].plot(label="DISH")
EA['Cumulative Return'].plot(label="EA")
FB['Cumulative Return'].plot(label="FB")
FOXA['Cumulative Return'].plot(label="FOXA")
FOX['Cumulative Return'].plot(label="FOX")
IPG['Cumulative Return'].plot(label="IPG")
LYV['Cumulative Return'].plot(label="LYV")
NFLX['Cumulative Return'].plot(label="NFLX")
NWSA['Cumulative Return'].plot(label="NWSA")
NWS['Cumulative Return'].plot(label="NWS")
OMC['Cumulative Return'].plot(label="OMC")
TMUS['Cumulative Return'].plot(label="TMUS")
TTWO['Cumulative Return'].plot(label="TTWO")
TWTR['Cumulative Return'].plot(label="TWTR")
VZ['Cumulative Return'].plot(label="VZ")
VIAC['Cumulative Return'].plot(label="VIAC")
DIS['Cumulative Return'].plot(label="DIS")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Sorting by Cumulative Return
cumret = {'Cumulative Returns 12/4-6/5': [sp['Cumulative Return'].iloc[-1],ATVI['Cumulative Return'].iloc[-1],GOOGL['Cumulative Return'].iloc[-1],GOOG['Cumulative Return'].iloc[-1],T['Cumulative Return'].iloc[-1],CTL['Cumulative Return'].iloc[-1],CHTR['Cumulative Return'].iloc[-1],CMCSA['Cumulative Return'].iloc[-1],DISCA['Cumulative Return'].iloc[-1],DISCK['Cumulative Return'].iloc[-1],DISH['Cumulative Return'].iloc[-1],EA['Cumulative Return'].iloc[-1],FB['Cumulative Return'].iloc[-1],FOXA['Cumulative Return'].iloc[-1],FOX['Cumulative Return'].iloc[-1],IPG['Cumulative Return'].iloc[-1],LYV['Cumulative Return'].iloc[-1],NFLX['Cumulative Return'].iloc[-1],NWSA['Cumulative Return'].iloc[-1],NWS['Cumulative Return'].iloc[-1],OMC['Cumulative Return'].iloc[-1],TMUS['Cumulative Return'].iloc[-1],TTWO['Cumulative Return'].iloc[-1],TWTR['Cumulative Return'].iloc[-1],VZ['Cumulative Return'].iloc[-1],VIAC['Cumulative Return'].iloc[-1],DIS['Cumulative Return'].iloc[-1]],
'Cumulative Returns 12/4-2/20': [spbef['Cumulative Return Before Crash'].iloc[-1],ATVIbef['Cumulative Return Before Crash'].iloc[-1],GOOGLbef['Cumulative Return Before Crash'].iloc[-1],GOOGbef['Cumulative Return Before Crash'].iloc[-1],Tbef['Cumulative Return Before Crash'].iloc[-1],CTLbef['Cumulative Return Before Crash'].iloc[-1],CHTRbef['Cumulative Return Before Crash'].iloc[-1],CMCSAbef['Cumulative Return Before Crash'].iloc[-1],DISCAbef['Cumulative Return Before Crash'].iloc[-1],DISCKbef['Cumulative Return Before Crash'].iloc[-1],DISHbef['Cumulative Return Before Crash'].iloc[-1],EAbef['Cumulative Return Before Crash'].iloc[-1],FBbef['Cumulative Return Before Crash'].iloc[-1],FOXAbef['Cumulative Return Before Crash'].iloc[-1],FOXbef['Cumulative Return Before Crash'].iloc[-1],IPGbef['Cumulative Return Before Crash'].iloc[-1],LYVbef['Cumulative Return Before Crash'].iloc[-1],NFLXbef['Cumulative Return Before Crash'].iloc[-1],NWSAbef['Cumulative Return Before Crash'].iloc[-1],NWSbef['Cumulative Return Before Crash'].iloc[-1],OMCbef['Cumulative Return Before Crash'].iloc[-1],TMUSbef['Cumulative Return Before Crash'].iloc[-1],TTWObef['Cumulative Return Before Crash'].iloc[-1],TWTRbef['Cumulative Return Before Crash'].iloc[-1],VZbef['Cumulative Return Before Crash'].iloc[-1],VIACbef['Cumulative Return Before Crash'].iloc[-1],DISbef['Cumulative Return Before Crash'].iloc[-1]],
'Cumulative Returns 2/20-3/23': [spdur['Cumulative Return During Crash'].iloc[-1],ATVIdur['Cumulative Return During Crash'].iloc[-1],GOOGLdur['Cumulative Return During Crash'].iloc[-1],GOOGdur['Cumulative Return During Crash'].iloc[-1],Tdur['Cumulative Return During Crash'].iloc[-1],CTLdur['Cumulative Return During Crash'].iloc[-1],CHTRdur['Cumulative Return During Crash'].iloc[-1],CMCSAdur['Cumulative Return During Crash'].iloc[-1],DISCAdur['Cumulative Return During Crash'].iloc[-1],DISCKdur['Cumulative Return During Crash'].iloc[-1],DISHdur['Cumulative Return During Crash'].iloc[-1],EAdur['Cumulative Return During Crash'].iloc[-1],FBdur['Cumulative Return During Crash'].iloc[-1],FOXAdur['Cumulative Return During Crash'].iloc[-1],FOXdur['Cumulative Return During Crash'].iloc[-1],IPGdur['Cumulative Return During Crash'].iloc[-1],LYVdur['Cumulative Return During Crash'].iloc[-1],NFLXdur['Cumulative Return During Crash'].iloc[-1],NWSAdur['Cumulative Return During Crash'].iloc[-1],NWSdur['Cumulative Return During Crash'].iloc[-1],OMCdur['Cumulative Return During Crash'].iloc[-1],TMUSdur['Cumulative Return During Crash'].iloc[-1],TTWOdur['Cumulative Return During Crash'].iloc[-1],TWTRdur['Cumulative Return During Crash'].iloc[-1],VZdur['Cumulative Return During Crash'].iloc[-1],VIACdur['Cumulative Return During Crash'].iloc[-1],DISdur['Cumulative Return During Crash'].iloc[-1]],
'Cumulative Returns 3/23-6/5': [spaft['Cumulative Return After Crash'].iloc[-1],ATVIaft['Cumulative Return After Crash'].iloc[-1],GOOGLaft['Cumulative Return After Crash'].iloc[-1],GOOGaft['Cumulative Return After Crash'].iloc[-1],Taft['Cumulative Return After Crash'].iloc[-1],CTLaft['Cumulative Return After Crash'].iloc[-1],CHTRaft['Cumulative Return After Crash'].iloc[-1],CMCSAaft['Cumulative Return After Crash'].iloc[-1],DISCAaft['Cumulative Return After Crash'].iloc[-1],DISCKaft['Cumulative Return After Crash'].iloc[-1],DISHaft['Cumulative Return After Crash'].iloc[-1],EAaft['Cumulative Return After Crash'].iloc[-1],FBaft['Cumulative Return After Crash'].iloc[-1],FOXAaft['Cumulative Return After Crash'].iloc[-1],FOXaft['Cumulative Return After Crash'].iloc[-1],IPGaft['Cumulative Return After Crash'].iloc[-1],LYVaft['Cumulative Return After Crash'].iloc[-1],NFLXaft['Cumulative Return After Crash'].iloc[-1],NWSAaft['Cumulative Return After Crash'].iloc[-1],NWSaft['Cumulative Return After Crash'].iloc[-1],OMCaft['Cumulative Return After Crash'].iloc[-1],TMUSaft['Cumulative Return After Crash'].iloc[-1],TTWOaft['Cumulative Return After Crash'].iloc[-1],TWTRaft['Cumulative Return After Crash'].iloc[-1],VZaft['Cumulative Return After Crash'].iloc[-1],VIACaft['Cumulative Return After Crash'].iloc[-1],DISaft['Cumulative Return After Crash'].iloc[-1]]}
csdf2 = pd.DataFrame(cumret, columns = ['Cumulative Returns 12/4-6/5', 'Cumulative Returns 12/4-2/20', 'Cumulative Returns 2/20-3/23', 'Cumulative Returns 3/23-6/5'], index= ['S&P 500','ATVI','GOOGL','GOOG','T','CTL','CHTR','CMCSA','DISCA','DISCK','DISH','EA','FB','FOXA','FOX','IPG','LYV','NFLX','NWSA','NWS','OMC','TMUS','TTWO','TWTR','VZ','VIAC','DIS'])
pd.DataFrame(csdf2)
csdf2.sort_values('Cumulative Returns 3/23-6/5', ascending=False)
#Table of Key Statistics of Communication Services Stocks
import pandas as pd
import statistics as stats
csmeans = [ATVImean,GOOGLmean,GOOGmean,Tmean,CTLmean,CHTRmean,CMCSAmean,DISCAmean,DISCKmean,DISHmean,EAmean,FBmean,FOXAmean,FOXmean,IPGmean,LYVmean,NFLXmean,NWSAmean,NWSmean,OMCmean,TMUSmean,TTWOmean,TWTRmean,VZmean,VIACmean,DISmean]
csaveragemean = stats.mean(csmeans)
csvariances = [ATVIvar,GOOGLvar,GOOGvar,Tvar,CTLvar,CHTRvar,CMCSAvar,DISCAvar,DISCKvar,DISHvar,EAvar,FBvar,FOXAvar,FOXvar,IPGvar,LYVvar,NFLXvar,NWSAvar,NWSvar,OMCvar,TMUSvar,TTWOvar,TWTRvar,VZvar,VIACvar,DISvar]
csaveragevar = stats.mean(csvariances)
cskurtoses = [ATVIkurt,GOOGLkurt,GOOGkurt,Tkurt,CTLkurt,CHTRkurt,CMCSAkurt,DISCAkurt,DISCKkurt,DISHkurt,EAkurt,FBkurt,FOXAkurt,FOXkurt,IPGkurt,LYVkurt,NFLXkurt,NWSAkurt,NWSkurt,OMCkurt,TMUSkurt,TTWOkurt,TWTRkurt,VZkurt,VIACkurt,DISkurt]
csaveragekurt = stats.mean(cskurtoses)
csskews = [ATVIskew,GOOGLskew,GOOGskew,Tskew,CTLskew,CHTRskew,CMCSAskew,DISCAskew,DISCKskew,DISHskew,EAskew,FBskew,FOXAskew,FOXskew,IPGskew,LYVskew,NFLXskew,NWSAskew,NWSskew,OMCskew,TMUSskew,TTWOskew,TWTRskew,VZskew,VIACskew,DISskew]
csaverageskew = stats.mean(csskews)
Communication_Services = {'Mean': [[spmean],[csaveragemean],[ATVImean], [GOOGLmean],[GOOGmean],[Tmean],[CTLmean],[CHTRmean],[CMCSAmean],[DISCAmean],[DISCKmean],[DISHmean],[EAmean],[FBmean],[FOXAmean],[FOXmean],[IPGmean],[LYVmean],[NFLXmean],[NWSAmean],[NWSmean],[OMCmean],[TMUSmean],[TTWOmean],[TWTRmean],[VZmean],[VIACmean],[DISmean]],
'Variance': [[spvar],[csaveragevar],[ATVIvar],[GOOGLvar],[GOOGvar],[Tvar],[CTLvar],[CHTRvar],[CMCSAvar],[DISCAvar],[DISCKvar],[DISHvar],[EAvar],[FBvar],[FOXAvar],[FOXvar],[IPGvar],[LYVvar],[NFLXvar],[NWSAvar],[NWSvar],[OMCvar],[TMUSvar],[TTWOvar],[TWTRvar],[VZvar],[VIACvar],[DISvar]],
'Kurtosis': [[spkurt],[csaveragekurt],[ATVIkurt],[GOOGLkurt],[GOOGkurt],[Tkurt],[CTLkurt],[CHTRkurt],[CMCSAkurt],[DISCAkurt],[DISCKkurt],[DISHkurt],[EAkurt],[FBkurt],[FOXAkurt],[FOXkurt],[IPGkurt],[LYVkurt],[NFLXkurt],[NWSAkurt],[NWSkurt],[OMCkurt],[TMUSkurt],[TTWOkurt],[TWTRkurt],[VZkurt],[VIACkurt],[DISkurt]],
'Skew': [[spskew],[csaverageskew],[ATVIskew],[GOOGLskew],[GOOGskew],[Tskew],[CTLskew],[CHTRskew],[CMCSAskew],[DISCAskew],[DISCKskew],[DISHskew],[EAskew],[FBskew],[FOXAskew],[FOXskew],[IPGskew],[LYVskew],[NFLXskew],[NWSAskew],[NWSskew],[OMCskew],[TMUSskew],[TTWOskew],[TWTRskew],[VZskew],[VIACskew],[DISskew]],
}
csdf = pd.DataFrame(Communication_Services, columns = ['Mean', 'Variance', 'Kurtosis', 'Skew'], index= ['S&P 500','Average','ATVI','GOOGL','GOOG','T','CTL','CHTR','CMCSA','DISCA','DISCK','DISH','EA','FB','FOXA','FOX','IPG','LYV','NFLX','NWSA','NWS','OMC','TMUS','TTWO','TWTR','VZ','VIAC','DIS']
)
pd.DataFrame(csdf)
csdf.sort_values("Mean", ascending=False)
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AES = web.DataReader('AES', 'yahoo', start, end)
AES['returns'] = AES['Close'].pct_change(1)
AES['Cumulative Return'] = (1 + AES['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AESmean = AES['returns'].mean()
AESvar = AES['returns'].var()
AESkurt = AES['returns'].kurt()
AESskew = AES['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AESbef = web.DataReader('AES', 'yahoo', start, crashstart)
AESbef['avgreturnbefore'] = AESbef['Close'].pct_change(1)
AESbef['Cumulative Return Before Crash'] = (1 + AESbef['avgreturnbefore']).cumprod()
#period of crash
AESdur = web.DataReader('AES', 'yahoo', crashstart, crashend)
AESdur['avgreturnduring'] = AESdur['Close'].pct_change(1)
AESdur['Cumulative Return During Crash'] = (1 + AESdur['avgreturnduring']).cumprod()
#period after crash
AESaft = web.DataReader('AES', 'yahoo', crashend, end)
AESaft['avgreturnafter'] = AESaft['Close'].pct_change(1)
AESaft['Cumulative Return After Crash'] = (1 + AESaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
LNT = web.DataReader('LNT', 'yahoo', start, end)
LNT['returns'] = LNT['Close'].pct_change(1)
LNT['Cumulative Return'] = (1 + LNT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
LNTmean = LNT['returns'].mean()
LNTvar = LNT['returns'].var()
LNTkurt = LNT['returns'].kurt()
LNTskew = LNT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
LNTbef = web.DataReader('LNT', 'yahoo', start, crashstart)
LNTbef['avgreturnbefore'] = LNTbef['Close'].pct_change(1)
LNTbef['Cumulative Return Before Crash'] = (1 + LNTbef['avgreturnbefore']).cumprod()
#period of crash
LNTdur = web.DataReader('LNT', 'yahoo', crashstart, crashend)
LNTdur['avgreturnduring'] = LNTdur['Close'].pct_change(1)
LNTdur['Cumulative Return During Crash'] = (1 + LNTdur['avgreturnduring']).cumprod()
#period after crash
LNTaft = web.DataReader('LNT', 'yahoo', crashend, end)
LNTaft['avgreturnafter'] = LNTaft['Close'].pct_change(1)
LNTaft['Cumulative Return After Crash'] = (1 + LNTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AEE = web.DataReader('AEE', 'yahoo', start, end)
AEE['returns'] = AEE['Close'].pct_change(1)
AEE['Cumulative Return'] = (1 + AEE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AEEmean = AEE['returns'].mean()
AEEvar = AEE['returns'].var()
AEEkurt = AEE['returns'].kurt()
AEEskew = AEE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AEEbef = web.DataReader('AEE', 'yahoo', start, crashstart)
AEEbef['avgreturnbefore'] = AEEbef['Close'].pct_change(1)
AEEbef['Cumulative Return Before Crash'] = (1 + AEEbef['avgreturnbefore']).cumprod()
#period of crash
AEEdur = web.DataReader('AEE', 'yahoo', crashstart, crashend)
AEEdur['avgreturnduring'] = AEEdur['Close'].pct_change(1)
AEEdur['Cumulative Return During Crash'] = (1 + AEEdur['avgreturnduring']).cumprod()
#period after crash
AEEaft = web.DataReader('AEE', 'yahoo', crashend, end)
AEEaft['avgreturnafter'] = AEEaft['Close'].pct_change(1)
AEEaft['Cumulative Return After Crash'] = (1 + AEEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AEP = web.DataReader('AEP', 'yahoo', start, end)
AEP['returns'] = AEP['Close'].pct_change(1)
AEP['Cumulative Return'] = (1 + AEP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AEPmean = AEP['returns'].mean()
AEPvar = AEP['returns'].var()
AEPkurt = AEP['returns'].kurt()
AEPskew = AEP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AEPbef = web.DataReader('AEP', 'yahoo', start, crashstart)
AEPbef['avgreturnbefore'] = AEPbef['Close'].pct_change(1)
AEPbef['Cumulative Return Before Crash'] = (1 + AEPbef['avgreturnbefore']).cumprod()
#period of crash
AEPdur = web.DataReader('AEP', 'yahoo', crashstart, crashend)
AEPdur['avgreturnduring'] = AEPdur['Close'].pct_change(1)
AEPdur['Cumulative Return During Crash'] = (1 + AEPdur['avgreturnduring']).cumprod()
#period after crash
AEPaft = web.DataReader('AEP', 'yahoo', crashend, end)
AEPaft['avgreturnafter'] = AEPaft['Close'].pct_change(1)
AEPaft['Cumulative Return After Crash'] = (1 + AEPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AWK = web.DataReader('AWK', 'yahoo', start, end)
AWK['returns'] = AWK['Close'].pct_change(1)
AWK['Cumulative Return'] = (1 + AWK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AWKmean = AWK['returns'].mean()
AWKvar = AWK['returns'].var()
AWKkurt = AWK['returns'].kurt()
AWKskew = AWK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AWKbef = web.DataReader('AWK', 'yahoo', start, crashstart)
AWKbef['avgreturnbefore'] = AWKbef['Close'].pct_change(1)
AWKbef['Cumulative Return Before Crash'] = (1 + AWKbef['avgreturnbefore']).cumprod()
#period of crash
AWKdur = web.DataReader('AWK', 'yahoo', crashstart, crashend)
AWKdur['avgreturnduring'] = AWKdur['Close'].pct_change(1)
AWKdur['Cumulative Return During Crash'] = (1 + AWKdur['avgreturnduring']).cumprod()
#period after crash
AWKaft = web.DataReader('AWK', 'yahoo', crashend, end)
AWKaft['avgreturnafter'] = AWKaft['Close'].pct_change(1)
AWKaft['Cumulative Return After Crash'] = (1 + AWKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ATO = web.DataReader('ATO', 'yahoo', start, end)
ATO['returns'] = ATO['Close'].pct_change(1)
ATO['Cumulative Return'] = (1 + ATO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ATOmean = ATO['returns'].mean()
ATOvar = ATO['returns'].var()
ATOkurt = ATO['returns'].kurt()
ATOskew = ATO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ATObef = web.DataReader('ATO', 'yahoo', start, crashstart)
ATObef['avgreturnbefore'] = ATObef['Close'].pct_change(1)
ATObef['Cumulative Return Before Crash'] = (1 + ATObef['avgreturnbefore']).cumprod()
#period of crash
ATOdur = web.DataReader('ATO', 'yahoo', crashstart, crashend)
ATOdur['avgreturnduring'] = ATOdur['Close'].pct_change(1)
ATOdur['Cumulative Return During Crash'] = (1 + ATOdur['avgreturnduring']).cumprod()
#period after crash
ATOaft = web.DataReader('ATO', 'yahoo', crashend, end)
ATOaft['avgreturnafter'] = ATOaft['Close'].pct_change(1)
ATOaft['Cumulative Return After Crash'] = (1 + ATOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CNP = web.DataReader('CNP', 'yahoo', start, end)
CNP['returns'] = CNP['Close'].pct_change(1)
CNP['Cumulative Return'] = (1 + CNP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CNPmean = CNP['returns'].mean()
CNPvar = CNP['returns'].var()
CNPkurt = CNP['returns'].kurt()
CNPskew = CNP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CNPbef = web.DataReader('CNP', 'yahoo', start, crashstart)
CNPbef['avgreturnbefore'] = CNPbef['Close'].pct_change(1)
CNPbef['Cumulative Return Before Crash'] = (1 + CNPbef['avgreturnbefore']).cumprod()
#period of crash
CNPdur = web.DataReader('CNP', 'yahoo', crashstart, crashend)
CNPdur['avgreturnduring'] = CNPdur['Close'].pct_change(1)
CNPdur['Cumulative Return During Crash'] = (1 + CNPdur['avgreturnduring']).cumprod()
#period after crash
CNPaft = web.DataReader('CNP', 'yahoo', crashend, end)
CNPaft['avgreturnafter'] = CNPaft['Close'].pct_change(1)
CNPaft['Cumulative Return After Crash'] = (1 + CNPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CMS = web.DataReader('CMS', 'yahoo', start, end)
CMS['returns'] = CMS['Close'].pct_change(1)
CMS['Cumulative Return'] = (1 + CMS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CMSmean = CMS['returns'].mean()
CMSvar = CMS['returns'].var()
CMSkurt = CMS['returns'].kurt()
CMSskew = CMS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CMSbef = web.DataReader('CMS', 'yahoo', start, crashstart)
CMSbef['avgreturnbefore'] = CMSbef['Close'].pct_change(1)
CMSbef['Cumulative Return Before Crash'] = (1 + CMSbef['avgreturnbefore']).cumprod()
#period of crash
CMSdur = web.DataReader('CMS', 'yahoo', crashstart, crashend)
CMSdur['avgreturnduring'] = CMSdur['Close'].pct_change(1)
CMSdur['Cumulative Return During Crash'] = (1 + CMSdur['avgreturnduring']).cumprod()
#period after crash
CMSaft = web.DataReader('CMS', 'yahoo', crashend, end)
CMSaft['avgreturnafter'] = CMSaft['Close'].pct_change(1)
CMSaft['Cumulative Return After Crash'] = (1 + CMSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ED = web.DataReader('ED', 'yahoo', start, end)
ED['returns'] = ED['Close'].pct_change(1)
ED['Cumulative Return'] = (1 + ED['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EDmean = ED['returns'].mean()
EDvar = ED['returns'].var()
EDkurt = ED['returns'].kurt()
EDskew = ED['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EDbef = web.DataReader('ED', 'yahoo', start, crashstart)
EDbef['avgreturnbefore'] = EDbef['Close'].pct_change(1)
EDbef['Cumulative Return Before Crash'] = (1 + EDbef['avgreturnbefore']).cumprod()
#period of crash
EDdur = web.DataReader('ED', 'yahoo', crashstart, crashend)
EDdur['avgreturnduring'] = EDdur['Close'].pct_change(1)
EDdur['Cumulative Return During Crash'] = (1 + EDdur['avgreturnduring']).cumprod()
#period after crash
EDaft = web.DataReader('ED', 'yahoo', crashend, end)
EDaft['avgreturnafter'] = EDaft['Close'].pct_change(1)
EDaft['Cumulative Return After Crash'] = (1 + EDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
D = web.DataReader('D', 'yahoo', start, end)
D['returns'] = D['Close'].pct_change(1)
D['Cumulative Return'] = (1 + D['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
Dmean = D['returns'].mean()
Dvar = D['returns'].var()
Dkurt = D['returns'].kurt()
Dskew = D['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
Dbef = web.DataReader('D', 'yahoo', start, crashstart)
Dbef['avgreturnbefore'] = Dbef['Close'].pct_change(1)
Dbef['Cumulative Return Before Crash'] = (1 + Dbef['avgreturnbefore']).cumprod()
#period of crash
Ddur = web.DataReader('D', 'yahoo', crashstart, crashend)
Ddur['avgreturnduring'] = Ddur['Close'].pct_change(1)
Ddur['Cumulative Return During Crash'] = (1 + Ddur['avgreturnduring']).cumprod()
#period after crash
Daft = web.DataReader('D', 'yahoo', crashend, end)
Daft['avgreturnafter'] = Daft['Close'].pct_change(1)
Daft['Cumulative Return After Crash'] = (1 + Daft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DTE = web.DataReader('DTE', 'yahoo', start, end)
DTE['returns'] = DTE['Close'].pct_change(1)
DTE['Cumulative Return'] = (1 + DTE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DTEmean = DTE['returns'].mean()
DTEvar = DTE['returns'].var()
DTEkurt = DTE['returns'].kurt()
DTEskew = DTE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DTEbef = web.DataReader('DTE', 'yahoo', start, crashstart)
DTEbef['avgreturnbefore'] = DTEbef['Close'].pct_change(1)
DTEbef['Cumulative Return Before Crash'] = (1 + DTEbef['avgreturnbefore']).cumprod()
#period of crash
DTEdur = web.DataReader('DTE', 'yahoo', crashstart, crashend)
DTEdur['avgreturnduring'] = DTEdur['Close'].pct_change(1)
DTEdur['Cumulative Return During Crash'] = (1 + DTEdur['avgreturnduring']).cumprod()
#period after crash
DTEaft = web.DataReader('DTE', 'yahoo', crashend, end)
DTEaft['avgreturnafter'] = DTEaft['Close'].pct_change(1)
DTEaft['Cumulative Return After Crash'] = (1 + DTEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DUK = web.DataReader('DUK', 'yahoo', start, end)
DUK['returns'] = DUK['Close'].pct_change(1)
DUK['Cumulative Return'] = (1 + DUK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DUKmean = DUK['returns'].mean()
DUKvar = DUK['returns'].var()
DUKkurt = DUK['returns'].kurt()
DUKskew = DUK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DUKbef = web.DataReader('DUK', 'yahoo', start, crashstart)
DUKbef['avgreturnbefore'] = DUKbef['Close'].pct_change(1)
DUKbef['Cumulative Return Before Crash'] = (1 + DUKbef['avgreturnbefore']).cumprod()
#period of crash
DUKdur = web.DataReader('DUK', 'yahoo', crashstart, crashend)
DUKdur['avgreturnduring'] = DUKdur['Close'].pct_change(1)
DUKdur['Cumulative Return During Crash'] = (1 + DUKdur['avgreturnduring']).cumprod()
#period after crash
DUKaft = web.DataReader('DUK', 'yahoo', crashend, end)
DUKaft['avgreturnafter'] = DUKaft['Close'].pct_change(1)
DUKaft['Cumulative Return After Crash'] = (1 + DUKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EIX = web.DataReader('EIX', 'yahoo', start, end)
EIX['returns'] = EIX['Close'].pct_change(1)
EIX['Cumulative Return'] = (1 + EIX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EIXmean = EIX['returns'].mean()
EIXvar = EIX['returns'].var()
EIXkurt = EIX['returns'].kurt()
EIXskew = EIX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EIXbef = web.DataReader('EIX', 'yahoo', start, crashstart)
EIXbef['avgreturnbefore'] = EIXbef['Close'].pct_change(1)
EIXbef['Cumulative Return Before Crash'] = (1 + EIXbef['avgreturnbefore']).cumprod()
#period of crash
EIXdur = web.DataReader('EIX', 'yahoo', crashstart, crashend)
EIXdur['avgreturnduring'] = EIXdur['Close'].pct_change(1)
EIXdur['Cumulative Return During Crash'] = (1 + EIXdur['avgreturnduring']).cumprod()
#period after crash
EIXaft = web.DataReader('EIX', 'yahoo', crashend, end)
EIXaft['avgreturnafter'] = EIXaft['Close'].pct_change(1)
EIXaft['Cumulative Return After Crash'] = (1 + EIXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ETR = web.DataReader('ETR', 'yahoo', start, end)
ETR['returns'] = ETR['Close'].pct_change(1)
ETR['Cumulative Return'] = (1 + ETR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ETRmean = ETR['returns'].mean()
ETRvar = ETR['returns'].var()
ETRkurt = ETR['returns'].kurt()
ETRskew = ETR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ETRbef = web.DataReader('ETR', 'yahoo', start, crashstart)
ETRbef['avgreturnbefore'] = ETRbef['Close'].pct_change(1)
ETRbef['Cumulative Return Before Crash'] = (1 + ETRbef['avgreturnbefore']).cumprod()
#period of crash
ETRdur = web.DataReader('ETR', 'yahoo', crashstart, crashend)
ETRdur['avgreturnduring'] = ETRdur['Close'].pct_change(1)
ETRdur['Cumulative Return During Crash'] = (1 + ETRdur['avgreturnduring']).cumprod()
#period after crash
ETRaft = web.DataReader('ETR', 'yahoo', crashend, end)
ETRaft['avgreturnafter'] = ETRaft['Close'].pct_change(1)
ETRaft['Cumulative Return After Crash'] = (1 + ETRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EVRG = web.DataReader('EVRG', 'yahoo', start, end)
EVRG['returns'] = EVRG['Close'].pct_change(1)
EVRG['Cumulative Return'] = (1 + EVRG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EVRGmean = EVRG['returns'].mean()
EVRGvar = EVRG['returns'].var()
EVRGkurt = EVRG['returns'].kurt()
EVRGskew = EVRG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EVRGbef = web.DataReader('EVRG', 'yahoo', start, crashstart)
EVRGbef['avgreturnbefore'] = EVRGbef['Close'].pct_change(1)
EVRGbef['Cumulative Return Before Crash'] = (1 + EVRGbef['avgreturnbefore']).cumprod()
#period of crash
EVRGdur = web.DataReader('EVRG', 'yahoo', crashstart, crashend)
EVRGdur['avgreturnduring'] = EVRGdur['Close'].pct_change(1)
EVRGdur['Cumulative Return During Crash'] = (1 + EVRGdur['avgreturnduring']).cumprod()
#period after crash
EVRGaft = web.DataReader('EVRG', 'yahoo', crashend, end)
EVRGaft['avgreturnafter'] = EVRGaft['Close'].pct_change(1)
EVRGaft['Cumulative Return After Crash'] = (1 + EVRGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ES = web.DataReader('ES', 'yahoo', start, end)
ES['returns'] = ES['Close'].pct_change(1)
ES['Cumulative Return'] = (1 + ES['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ESmean = ES['returns'].mean()
ESvar = ES['returns'].var()
ESkurt = ES['returns'].kurt()
ESskew = ES['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ESbef = web.DataReader('ES', 'yahoo', start, crashstart)
ESbef['avgreturnbefore'] = ESbef['Close'].pct_change(1)
ESbef['Cumulative Return Before Crash'] = (1 + ESbef['avgreturnbefore']).cumprod()
#period of crash
ESdur = web.DataReader('ES', 'yahoo', crashstart, crashend)
ESdur['avgreturnduring'] = ESdur['Close'].pct_change(1)
ESdur['Cumulative Return During Crash'] = (1 + ESdur['avgreturnduring']).cumprod()
#period after crash
ESaft = web.DataReader('ES', 'yahoo', crashend, end)
ESaft['avgreturnafter'] = ESaft['Close'].pct_change(1)
ESaft['Cumulative Return After Crash'] = (1 + ESaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EXC = web.DataReader('EXC', 'yahoo', start, end)
EXC['returns'] = EXC['Close'].pct_change(1)
EXC['Cumulative Return'] = (1 + EXC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EXCmean = EXC['returns'].mean()
EXCvar = EXC['returns'].var()
EXCkurt = EXC['returns'].kurt()
EXCskew = EXC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EXCbef = web.DataReader('EXC', 'yahoo', start, crashstart)
EXCbef['avgreturnbefore'] = EXCbef['Close'].pct_change(1)
EXCbef['Cumulative Return Before Crash'] = (1 + EXCbef['avgreturnbefore']).cumprod()
#period of crash
EXCdur = web.DataReader('EXC', 'yahoo', crashstart, crashend)
EXCdur['avgreturnduring'] = EXCdur['Close'].pct_change(1)
EXCdur['Cumulative Return During Crash'] = (1 + EXCdur['avgreturnduring']).cumprod()
#period after crash
EXCaft = web.DataReader('EXC', 'yahoo', crashend, end)
EXCaft['avgreturnafter'] = EXCaft['Close'].pct_change(1)
EXCaft['Cumulative Return After Crash'] = (1 + EXCaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FE = web.DataReader('FE', 'yahoo', start, end)
FE['returns'] = FE['Close'].pct_change(1)
FE['Cumulative Return'] = (1 + FE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FEmean = FE['returns'].mean()
FEvar = FE['returns'].var()
FEkurt = FE['returns'].kurt()
FEskew = FE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FEbef = web.DataReader('FE', 'yahoo', start, crashstart)
FEbef['avgreturnbefore'] = FEbef['Close'].pct_change(1)
FEbef['Cumulative Return Before Crash'] = (1 + FEbef['avgreturnbefore']).cumprod()
#period of crash
FEdur = web.DataReader('FE', 'yahoo', crashstart, crashend)
FEdur['avgreturnduring'] = FEdur['Close'].pct_change(1)
FEdur['Cumulative Return During Crash'] = (1 + FEdur['avgreturnduring']).cumprod()
#period after crash
FEaft = web.DataReader('FE', 'yahoo', crashend, end)
FEaft['avgreturnafter'] = FEaft['Close'].pct_change(1)
FEaft['Cumulative Return After Crash'] = (1 + FEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NEE = web.DataReader('NEE', 'yahoo', start, end)
NEE['returns'] = NEE['Close'].pct_change(1)
NEE['Cumulative Return'] = (1 + NEE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NEEmean = NEE['returns'].mean()
NEEvar = NEE['returns'].var()
NEEkurt = NEE['returns'].kurt()
NEEskew = NEE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NEEbef = web.DataReader('NEE', 'yahoo', start, crashstart)
NEEbef['avgreturnbefore'] = NEEbef['Close'].pct_change(1)
NEEbef['Cumulative Return Before Crash'] = (1 + NEEbef['avgreturnbefore']).cumprod()
#period of crash
NEEdur = web.DataReader('NEE', 'yahoo', crashstart, crashend)
NEEdur['avgreturnduring'] = NEEdur['Close'].pct_change(1)
NEEdur['Cumulative Return During Crash'] = (1 + NEEdur['avgreturnduring']).cumprod()
#period after crash
NEEaft = web.DataReader('NEE', 'yahoo', crashend, end)
NEEaft['avgreturnafter'] = NEEaft['Close'].pct_change(1)
NEEaft['Cumulative Return After Crash'] = (1 + NEEaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NI = web.DataReader('NI', 'yahoo', start, end)
NI['returns'] = NI['Close'].pct_change(1)
NI['Cumulative Return'] = (1 + NI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NImean = NI['returns'].mean()
NIvar = NI['returns'].var()
NIkurt = NI['returns'].kurt()
NIskew = NI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NIbef = web.DataReader('NI', 'yahoo', start, crashstart)
NIbef['avgreturnbefore'] = NIbef['Close'].pct_change(1)
NIbef['Cumulative Return Before Crash'] = (1 + NIbef['avgreturnbefore']).cumprod()
#period of crash
NIdur = web.DataReader('NI', 'yahoo', crashstart, crashend)
NIdur['avgreturnduring'] = NIdur['Close'].pct_change(1)
NIdur['Cumulative Return During Crash'] = (1 + NIdur['avgreturnduring']).cumprod()
#period after crash
NIaft = web.DataReader('NI', 'yahoo', crashend, end)
NIaft['avgreturnafter'] = NIaft['Close'].pct_change(1)
NIaft['Cumulative Return After Crash'] = (1 + NIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
NRG = web.DataReader('NRG', 'yahoo', start, end)
NRG['returns'] = NRG['Close'].pct_change(1)
NRG['Cumulative Return'] = (1 + NRG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
NRGmean = NRG['returns'].mean()
NRGvar = NRG['returns'].var()
NRGkurt = NRG['returns'].kurt()
NRGskew = NRG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
NRGbef = web.DataReader('NRG', 'yahoo', start, crashstart)
NRGbef['avgreturnbefore'] = NRGbef['Close'].pct_change(1)
NRGbef['Cumulative Return Before Crash'] = (1 + NRGbef['avgreturnbefore']).cumprod()
#period of crash
NRGdur = web.DataReader('NRG', 'yahoo', crashstart, crashend)
NRGdur['avgreturnduring'] = NRGdur['Close'].pct_change(1)
NRGdur['Cumulative Return During Crash'] = (1 + NRGdur['avgreturnduring']).cumprod()
#period after crash
NRGaft = web.DataReader('NRG', 'yahoo', crashend, end)
NRGaft['avgreturnafter'] = NRGaft['Close'].pct_change(1)
NRGaft['Cumulative Return After Crash'] = (1 + NRGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PNW = web.DataReader('PNW', 'yahoo', start, end)
PNW['returns'] = PNW['Close'].pct_change(1)
PNW['Cumulative Return'] = (1 + PNW['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PNWmean = PNW['returns'].mean()
PNWvar = PNW['returns'].var()
PNWkurt = PNW['returns'].kurt()
PNWskew = PNW['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PNWbef = web.DataReader('PNW', 'yahoo', start, crashstart)
PNWbef['avgreturnbefore'] = PNWbef['Close'].pct_change(1)
PNWbef['Cumulative Return Before Crash'] = (1 + PNWbef['avgreturnbefore']).cumprod()
#period of crash
PNWdur = web.DataReader('PNW', 'yahoo', crashstart, crashend)
PNWdur['avgreturnduring'] = PNWdur['Close'].pct_change(1)
PNWdur['Cumulative Return During Crash'] = (1 + PNWdur['avgreturnduring']).cumprod()
#period after crash
PNWaft = web.DataReader('PNW', 'yahoo', crashend, end)
PNWaft['avgreturnafter'] = PNWaft['Close'].pct_change(1)
PNWaft['Cumulative Return After Crash'] = (1 + PNWaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PPL = web.DataReader('PPL', 'yahoo', start, end)
PPL['returns'] = PPL['Close'].pct_change(1)
PPL['Cumulative Return'] = (1 + PPL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PPLmean = PPL['returns'].mean()
PPLvar = PPL['returns'].var()
PPLkurt = PPL['returns'].kurt()
PPLskew = PPL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PPLbef = web.DataReader('PPL', 'yahoo', start, crashstart)
PPLbef['avgreturnbefore'] = PPLbef['Close'].pct_change(1)
PPLbef['Cumulative Return Before Crash'] = (1 + PPLbef['avgreturnbefore']).cumprod()
#period of crash
PPLdur = web.DataReader('PPL', 'yahoo', crashstart, crashend)
PPLdur['avgreturnduring'] = PPLdur['Close'].pct_change(1)
PPLdur['Cumulative Return During Crash'] = (1 + PPLdur['avgreturnduring']).cumprod()
#period after crash
PPLaft = web.DataReader('PPL', 'yahoo', crashend, end)
PPLaft['avgreturnafter'] = PPLaft['Close'].pct_change(1)
PPLaft['Cumulative Return After Crash'] = (1 + PPLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PEG = web.DataReader('PEG', 'yahoo', start, end)
PEG['returns'] = PEG['Close'].pct_change(1)
PEG['Cumulative Return'] = (1 + PEG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PEGmean = PEG['returns'].mean()
PEGvar = PEG['returns'].var()
PEGkurt = PEG['returns'].kurt()
PEGskew = PEG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PEGbef = web.DataReader('PEG', 'yahoo', start, crashstart)
PEGbef['avgreturnbefore'] = PEGbef['Close'].pct_change(1)
PEGbef['Cumulative Return Before Crash'] = (1 + PEGbef['avgreturnbefore']).cumprod()
#period of crash
PEGdur = web.DataReader('PEG', 'yahoo', crashstart, crashend)
PEGdur['avgreturnduring'] = PEGdur['Close'].pct_change(1)
PEGdur['Cumulative Return During Crash'] = (1 + PEGdur['avgreturnduring']).cumprod()
#period after crash
PEGaft = web.DataReader('PEG', 'yahoo', crashend, end)
PEGaft['avgreturnafter'] = PEGaft['Close'].pct_change(1)
PEGaft['Cumulative Return After Crash'] = (1 + PEGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SRE = web.DataReader('SRE', 'yahoo', start, end)
SRE['returns'] = SRE['Close'].pct_change(1)
SRE['Cumulative Return'] = (1 + SRE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SREmean = SRE['returns'].mean()
SREvar = SRE['returns'].var()
SREkurt = SRE['returns'].kurt()
SREskew = SRE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SREbef = web.DataReader('SRE', 'yahoo', start, crashstart)
SREbef['avgreturnbefore'] = SREbef['Close'].pct_change(1)
SREbef['Cumulative Return Before Crash'] = (1 + SREbef['avgreturnbefore']).cumprod()
#period of crash
SREdur = web.DataReader('SRE', 'yahoo', crashstart, crashend)
SREdur['avgreturnduring'] = SREdur['Close'].pct_change(1)
SREdur['Cumulative Return During Crash'] = (1 + SREdur['avgreturnduring']).cumprod()
#period after crash
SREaft = web.DataReader('SRE', 'yahoo', crashend, end)
SREaft['avgreturnafter'] = SREaft['Close'].pct_change(1)
SREaft['Cumulative Return After Crash'] = (1 + SREaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SO = web.DataReader('SO', 'yahoo', start, end)
SO['returns'] = SO['Close'].pct_change(1)
SO['Cumulative Return'] = (1 + SO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SOmean = SO['returns'].mean()
SOvar = SO['returns'].var()
SOkurt = SO['returns'].kurt()
SOskew = SO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SObef = web.DataReader('SO', 'yahoo', start, crashstart)
SObef['avgreturnbefore'] = SObef['Close'].pct_change(1)
SObef['Cumulative Return Before Crash'] = (1 + SObef['avgreturnbefore']).cumprod()
#period of crash
SOdur = web.DataReader('SO', 'yahoo', crashstart, crashend)
SOdur['avgreturnduring'] = SOdur['Close'].pct_change(1)
SOdur['Cumulative Return During Crash'] = (1 + SOdur['avgreturnduring']).cumprod()
#period after crash
SOaft = web.DataReader('SO', 'yahoo', crashend, end)
SOaft['avgreturnafter'] = SOaft['Close'].pct_change(1)
SOaft['Cumulative Return After Crash'] = (1 + SOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WEC = web.DataReader('WEC', 'yahoo', start, end)
WEC['returns'] = WEC['Close'].pct_change(1)
WEC['Cumulative Return'] = (1 + WEC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WECmean = WEC['returns'].mean()
WECvar = WEC['returns'].var()
WECkurt = WEC['returns'].kurt()
WECskew = WEC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WECbef = web.DataReader('WEC', 'yahoo', start, crashstart)
WECbef['avgreturnbefore'] = WECbef['Close'].pct_change(1)
WECbef['Cumulative Return Before Crash'] = (1 + WECbef['avgreturnbefore']).cumprod()
#period of crash
WECdur = web.DataReader('WEC', 'yahoo', crashstart, crashend)
WECdur['avgreturnduring'] = WECdur['Close'].pct_change(1)
WECdur['Cumulative Return During Crash'] = (1 + WECdur['avgreturnduring']).cumprod()
#period after crash
WECaft = web.DataReader('WEC', 'yahoo', crashend, end)
WECaft['avgreturnafter'] = WECaft['Close'].pct_change(1)
WECaft['Cumulative Return After Crash'] = (1 + WECaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
XEL = web.DataReader('XEL', 'yahoo', start, end)
XEL['returns'] = XEL['Close'].pct_change(1)
XEL['Cumulative Return'] = (1 + XEL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
XELmean = XEL['returns'].mean()
XELvar = XEL['returns'].var()
XELkurt = XEL['returns'].kurt()
XELskew = XEL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
XELbef = web.DataReader('XEL', 'yahoo', start, crashstart)
XELbef['avgreturnbefore'] = XELbef['Close'].pct_change(1)
XELbef['Cumulative Return Before Crash'] = (1 + XELbef['avgreturnbefore']).cumprod()
#period of crash
XELdur = web.DataReader('XEL', 'yahoo', crashstart, crashend)
XELdur['avgreturnduring'] = XELdur['Close'].pct_change(1)
XELdur['Cumulative Return During Crash'] = (1 + XELdur['avgreturnduring']).cumprod()
#period after crash
XELaft = web.DataReader('XEL', 'yahoo', crashend, end)
XELaft['avgreturnafter'] = XELaft['Close'].pct_change(1)
XELaft['Cumulative Return After Crash'] = (1 + XELaft['avgreturnafter']).cumprod()
#KDE Plot for Utilities Sector
sp['returns'].plot(kind = 'kde', label ='S&P 500', alpha=0.5)
AES['returns'].plot(kind = 'kde', label ='AES', figsize = (10,8), alpha=0.5, title = 'KDE of Utilities Stocks')
LNT['returns'].plot(kind = 'kde', label ='LNT', alpha=0.5)
AEE['returns'].plot(kind = 'kde', label ='AEE', alpha=0.5)
AEP['returns'].plot(kind = 'kde', label ='AEP', alpha=0.5)
AWK['returns'].plot(kind = 'kde', label ='AWK', alpha=0.5)
ATO['returns'].plot(kind = 'kde', label ='ATO', alpha=0.5)
CNP['returns'].plot(kind = 'kde', label ='CNP', alpha=0.5)
CMS['returns'].plot(kind = 'kde', label ='CMS', alpha=0.5)
ED['returns'].plot(kind = 'kde', label ='ED', alpha=0.5)
D['returns'].plot(kind = 'kde', label ='D', alpha=0.5)
DTE['returns'].plot(kind = 'kde', label ='DTE', alpha=0.5)
DUK['returns'].plot(kind = 'kde', label ='DUK', alpha=0.5)
EIX['returns'].plot(kind = 'kde', label ='EIX', alpha=0.5)
ETR['returns'].plot(kind = 'kde', label ='ETR', alpha=0.5)
EVRG['returns'].plot(kind = 'kde', label = 'EVRG', alpha=0.5)
ES['returns'].plot(kind = 'kde', label ='ES', alpha=0.5)
EXC['returns'].plot(kind = 'kde', label ='EXC', alpha=0.5)
FE['returns'].plot(kind = 'kde', label ='FE', alpha=0.5)
NEE['returns'].plot(kind = 'kde', label ='NEE', alpha=0.5)
NI['returns'].plot(kind = 'kde', label ='NI', alpha=0.5)
NRG['returns'].plot(kind = 'kde', label ='NRG', alpha=0.5)
PNW['returns'].plot(kind = 'kde', label ='PNW', alpha=0.5)
PPL['returns'].plot(kind = 'kde', label ='PPL', alpha=0.5)
PEG['returns'].plot(kind = 'kde', label ='PEG', alpha=0.5)
SRE['returns'].plot(kind = 'kde', label ='SRE', alpha=0.5)
SO['returns'].plot(kind = 'kde', label ='SO', alpha=0.5)
WEC['returns'].plot(kind = 'kde', label ='WEC', alpha=0.5)
XEL['returns'].plot(kind = 'kde', label ='XEL', alpha=0.5)
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Boxplots comparing returns for Utilities Sector
box_df = pd.concat([sp['returns'],AES['returns'],LNT['returns'],AEE['returns'],AEP['returns'],AWK['returns'],ATO['returns'],CNP['returns'],CMS['returns'],ED['returns'],D['returns'],DTE['returns'],DUK['returns'],EIX['returns'],ETR['returns'],EVRG['returns'],ES['returns'],EXC['returns'],FE['returns'],NEE['returns'],NI['returns'],NRG['returns'],PNW['returns'],PPL['returns'],PEG['returns'],SRE['returns'],SO['returns'],WEC['returns'],XEL['returns']], axis=1)
box_df.columns = ['S&P 500','AES','LNT','AEE','AEP','AWK','ATO','CNP','CMS','ED','D','DTE','DUK','EIX','ETR','EVRG','ES','EXC','FE','NEE','NI','NRG','PNW','PPL','PEG','SRE','SO','WEC','XEL']
box_df.plot(kind='box', figsize=(30,10), colormap= 'jet', title = 'Boxplots of Utilities Sector Returns')
#Cumulative Returns of Utilities Stocks for Whole period
sp['Cumulative Return'].plot(label="S&P 500")
AES['Cumulative Return'].plot(label='AES', figsize=(16,8), title = 'Cumulative Return of Utilities Stocks')
LNT['Cumulative Return'].plot(label="LNT")
AEE['Cumulative Return'].plot(label="AEE")
AEP['Cumulative Return'].plot(label="AEP")
AWK['Cumulative Return'].plot(label="AWK")
ATO['Cumulative Return'].plot(label="ATO")
CNP['Cumulative Return'].plot(label="CNP")
CMS['Cumulative Return'].plot(label="CMS")
ED['Cumulative Return'].plot(label="ED")
D['Cumulative Return'].plot(label="D")
DTE['Cumulative Return'].plot(label="DTE")
DUK['Cumulative Return'].plot(label="DUK")
EIX['Cumulative Return'].plot(label="EIX")
ETR['Cumulative Return'].plot(label="ETR")
EVRG['Cumulative Return'].plot(label="EVRG")
ES['Cumulative Return'].plot(label="ES")
EXC['Cumulative Return'].plot(label="EXC")
FE['Cumulative Return'].plot(label="FE")
NEE['Cumulative Return'].plot(label="NEE")
NI['Cumulative Return'].plot(label="NI")
NRG['Cumulative Return'].plot(label="NRG")
PNW['Cumulative Return'].plot(label="PNW")
PPL['Cumulative Return'].plot(label="PPL")
PEG['Cumulative Return'].plot(label="PEG")
SRE['Cumulative Return'].plot(label="SRE")
SO['Cumulative Return'].plot(label="SO")
WEC['Cumulative Return'].plot(label="WEC")
XEL['Cumulative Return'].plot(label="XEL")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Sorting by Cumulative Return
cumret = {'Cumulative Returns 12/4-6/5': [sp['Cumulative Return'].iloc[-1],AES['Cumulative Return'].iloc[-1],LNT['Cumulative Return'].iloc[-1],AEE['Cumulative Return'].iloc[-1],AEP['Cumulative Return'].iloc[-1],AWK['Cumulative Return'].iloc[-1],ATO['Cumulative Return'].iloc[-1],CNP['Cumulative Return'].iloc[-1],CMS['Cumulative Return'].iloc[-1],ED['Cumulative Return'].iloc[-1],D['Cumulative Return'].iloc[-1],DTE['Cumulative Return'].iloc[-1],DUK['Cumulative Return'].iloc[-1],EIX['Cumulative Return'].iloc[-1],ETR['Cumulative Return'].iloc[-1],EVRG['Cumulative Return'].iloc[-1],ES['Cumulative Return'].iloc[-1],EXC['Cumulative Return'].iloc[-1],FE['Cumulative Return'].iloc[-1],NEE['Cumulative Return'].iloc[-1],NI['Cumulative Return'].iloc[-1],NRG['Cumulative Return'].iloc[-1],PNW['Cumulative Return'].iloc[-1],PPL['Cumulative Return'].iloc[-1],PEG['Cumulative Return'].iloc[-1],SRE['Cumulative Return'].iloc[-1],SO['Cumulative Return'].iloc[-1],WEC['Cumulative Return'].iloc[-1],XEL['Cumulative Return'].iloc[-1]],
'Cumulative Returns 12/4-2/20': [spbef['Cumulative Return Before Crash'].iloc[-1],AESbef['Cumulative Return Before Crash'].iloc[-1],LNTbef['Cumulative Return Before Crash'].iloc[-1],AEEbef['Cumulative Return Before Crash'].iloc[-1],AEPbef['Cumulative Return Before Crash'].iloc[-1],AWKbef['Cumulative Return Before Crash'].iloc[-1],ATObef['Cumulative Return Before Crash'].iloc[-1],CNPbef['Cumulative Return Before Crash'].iloc[-1],CMSbef['Cumulative Return Before Crash'].iloc[-1],EDbef['Cumulative Return Before Crash'].iloc[-1],Dbef['Cumulative Return Before Crash'].iloc[-1],DTEbef['Cumulative Return Before Crash'].iloc[-1],DUKbef['Cumulative Return Before Crash'].iloc[-1],EIXbef['Cumulative Return Before Crash'].iloc[-1],ETRbef['Cumulative Return Before Crash'].iloc[-1],EVRGbef['Cumulative Return Before Crash'].iloc[-1],ESbef['Cumulative Return Before Crash'].iloc[-1],EXCbef['Cumulative Return Before Crash'].iloc[-1],FEbef['Cumulative Return Before Crash'].iloc[-1],NEEbef['Cumulative Return Before Crash'].iloc[-1],NIbef['Cumulative Return Before Crash'].iloc[-1],NRGbef['Cumulative Return Before Crash'].iloc[-1],PNWbef['Cumulative Return Before Crash'].iloc[-1],PPLbef['Cumulative Return Before Crash'].iloc[-1],PEGbef['Cumulative Return Before Crash'].iloc[-1],SREbef['Cumulative Return Before Crash'].iloc[-1],SObef['Cumulative Return Before Crash'].iloc[-1],WECbef['Cumulative Return Before Crash'].iloc[-1],XELbef['Cumulative Return Before Crash'].iloc[-1]],
'Cumulative Returns 2/20-3/23': [spdur['Cumulative Return During Crash'].iloc[-1],AESdur['Cumulative Return During Crash'].iloc[-1],LNTdur['Cumulative Return During Crash'].iloc[-1],AEEdur['Cumulative Return During Crash'].iloc[-1],AEPdur['Cumulative Return During Crash'].iloc[-1],AWKdur['Cumulative Return During Crash'].iloc[-1],ATOdur['Cumulative Return During Crash'].iloc[-1],CNPdur['Cumulative Return During Crash'].iloc[-1],CMSdur['Cumulative Return During Crash'].iloc[-1],EDdur['Cumulative Return During Crash'].iloc[-1],Ddur['Cumulative Return During Crash'].iloc[-1],DTEdur['Cumulative Return During Crash'].iloc[-1],DUKdur['Cumulative Return During Crash'].iloc[-1],EIXdur['Cumulative Return During Crash'].iloc[-1],ETRdur['Cumulative Return During Crash'].iloc[-1],EVRGdur['Cumulative Return During Crash'].iloc[-1],ESdur['Cumulative Return During Crash'].iloc[-1],EXCdur['Cumulative Return During Crash'].iloc[-1],FEdur['Cumulative Return During Crash'].iloc[-1],NEEdur['Cumulative Return During Crash'].iloc[-1],NIdur['Cumulative Return During Crash'].iloc[-1],NRGdur['Cumulative Return During Crash'].iloc[-1],PNWdur['Cumulative Return During Crash'].iloc[-1],PPLdur['Cumulative Return During Crash'].iloc[-1],PEGdur['Cumulative Return During Crash'].iloc[-1],SREdur['Cumulative Return During Crash'].iloc[-1],SOdur['Cumulative Return During Crash'].iloc[-1],WECdur['Cumulative Return During Crash'].iloc[-1],XELdur['Cumulative Return During Crash'].iloc[-1]],
'Cumulative Returns 3/23-6/5': [spaft['Cumulative Return After Crash'].iloc[-1],AESaft['Cumulative Return After Crash'].iloc[-1],LNTaft['Cumulative Return After Crash'].iloc[-1],AEEaft['Cumulative Return After Crash'].iloc[-1],AEPaft['Cumulative Return After Crash'].iloc[-1],AWKaft['Cumulative Return After Crash'].iloc[-1],ATOaft['Cumulative Return After Crash'].iloc[-1],CNPaft['Cumulative Return After Crash'].iloc[-1],CMSaft['Cumulative Return After Crash'].iloc[-1],EDaft['Cumulative Return After Crash'].iloc[-1],Daft['Cumulative Return After Crash'].iloc[-1],DTEaft['Cumulative Return After Crash'].iloc[-1],DUKaft['Cumulative Return After Crash'].iloc[-1],EIXaft['Cumulative Return After Crash'].iloc[-1],ETRaft['Cumulative Return After Crash'].iloc[-1],EVRGaft['Cumulative Return After Crash'].iloc[-1],ESaft['Cumulative Return After Crash'].iloc[-1],EXCaft['Cumulative Return After Crash'].iloc[-1],FEaft['Cumulative Return After Crash'].iloc[-1],NEEaft['Cumulative Return After Crash'].iloc[-1],NIaft['Cumulative Return After Crash'].iloc[-1],NRGaft['Cumulative Return After Crash'].iloc[-1],PNWaft['Cumulative Return After Crash'].iloc[-1],PPLaft['Cumulative Return After Crash'].iloc[-1],PEGaft['Cumulative Return After Crash'].iloc[-1],SREaft['Cumulative Return After Crash'].iloc[-1],SOaft['Cumulative Return After Crash'].iloc[-1],WECaft['Cumulative Return After Crash'].iloc[-1],XELaft['Cumulative Return After Crash'].iloc[-1]]}
udf2 = pd.DataFrame(cumret, columns = ['Cumulative Returns 12/4-6/5', 'Cumulative Returns 12/4-2/20', 'Cumulative Returns 2/20-3/23', 'Cumulative Returns 3/23-6/5'], index= ['S&P 500','AES','LNT','AEE','AEP','AWK','ATO','CNP','CMS','ED','D','DTE','DUK','EIX','ETR','EVRG','ES','EXC','FE','NEE','NI','NRG','PNW','PPL','PEG','SRE','SO','WEC','XEL'])
pd.DataFrame(udf2)
udf2.sort_values('Cumulative Returns 3/23-6/5', ascending=False)
#Table of Key Statistics of Utilities Stocks
import pandas as pd
import statistics as stats
umeans = [AESmean,LNTmean,AEEmean,AEPmean,AWKmean,ATOmean,CNPmean,CMSmean,EDmean,Dmean,DTEmean,DUKmean,EIXmean,ETRmean,EVRGmean,ESmean,EXCmean,FEmean,NEEmean,NImean,NRGmean,PNWmean,PPLmean,PEGmean,SREmean,SOmean,WECmean,XELmean]
uaveragemean = stats.mean(umeans)
uvariances = [AESvar,LNTvar,AEEvar,AEPvar,AWKvar,ATOvar,CNPvar,CMSvar,EDvar,Dvar,DTEvar,DUKvar,EIXvar,ETRvar,EVRGvar,ESvar,EXCvar,FEvar,NEEvar,NIvar,NRGvar,PNWvar,PPLvar,PEGvar,SREvar,SOvar,WECvar,XELvar]
uaveragevar = stats.mean(uvariances)
ukurtoses = [AESkurt,LNTkurt,AEEkurt,AEPkurt,AWKkurt,ATOkurt,CNPkurt,CMSkurt,EDkurt,Dkurt,DTEkurt,DUKkurt,EIXkurt,ETRkurt,EVRGkurt,ESkurt,EXCkurt,FEkurt,NEEkurt,NIkurt,NRGkurt,PNWkurt,PPLkurt,PEGkurt,SREkurt,SOkurt,WECkurt,XELkurt]
uaveragekurt = stats.mean(ukurtoses)
uskews = [AESskew,LNTskew,AEEskew,AEPskew,AWKskew,ATOskew,CNPskew,CMSskew,EDskew,Dskew,DTEskew,DUKskew,EIXskew,ETRskew,EVRGskew,ESskew,EXCskew,FEskew,NEEskew,NIskew,NRGskew,PNWskew,PPLskew,PEGskew,SREskew,SOskew,WECskew,XELskew]
uaverageskew = stats.mean(uskews)
Utilities = {'Mean': [[spmean],[uaveragemean],[AESmean], [LNTmean],[AEEmean],[AEPmean],[AWKmean],[ATOmean],[CNPmean],[CMSmean],[EDmean],[Dmean],[DTEmean],[DUKmean],[EIXmean],[ETRmean],[EVRGmean],[ESmean],[EXCmean],[FEmean],[NEEmean],[NImean],[NRGmean],[PNWmean],[PPLmean],[PEGmean],[SREmean],[SOmean],[WECmean],[XELmean]],
'Variance': [[spvar],[uaveragevar],[AESvar],[LNTvar],[AEEvar],[AEPvar],[AWKvar],[ATOvar],[CNPvar],[CMSvar],[EDvar],[Dvar],[DTEvar],[DUKvar],[EIXvar],[ETRvar],[EVRGvar],[ESvar],[EXCvar],[FEvar],[NEEvar],[NIvar],[NRGvar],[PNWvar],[PPLvar],[PEGvar],[SREvar],[SOvar],[WECvar],[XELvar]],
'Kurtosis': [[spkurt],[uaveragekurt],[AESkurt],[LNTkurt],[AEEkurt],[AEPkurt],[AWKkurt],[ATOkurt],[CNPkurt],[CMSkurt],[EDkurt],[Dkurt],[DTEkurt],[DUKkurt],[EIXkurt],[ETRkurt],[EVRGkurt],[ESkurt],[EXCkurt],[FEkurt],[NEEkurt],[NIkurt],[NRGkurt],[PNWkurt],[PPLkurt],[PEGkurt],[SREkurt],[SOkurt],[WECkurt],[XELkurt]],
'Skew': [[spskew],[uaverageskew],[AESskew],[LNTskew],[AEEskew],[AEPskew],[AWKskew],[ATOskew],[CNPskew],[CMSskew],[EDskew],[Dskew],[DTEskew],[DUKskew],[EIXskew],[ETRskew],[EVRGskew],[ESskew],[EXCskew],[FEskew],[NEEskew],[NIskew],[NRGskew],[PNWskew],[PPLskew],[PEGskew],[SREskew],[SOskew],[WECskew],[XELskew]],
}
udf = pd.DataFrame(Utilities, columns = ['Mean', 'Variance', 'Kurtosis', 'Skew'], index= ['S&P 500','Average','AES','LNT','AEE','AEP','AWK','ATO','CNP','CMS','ED','D','DTE','DUK','EIX','ETR','EVRG','ES','EXC','FE','NEE','NI','NRG','PNW','PPL','PEG','SRE','SO','WEC','XEL']
)
pd.DataFrame(udf)
udf.sort_values("Mean", ascending=False)
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ARE = web.DataReader('ARE', 'yahoo', start, end)
ARE['returns'] = ARE['Close'].pct_change(1)
ARE['Cumulative Return'] = (1 + ARE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AREmean = ARE['returns'].mean()
AREvar = ARE['returns'].var()
AREkurt = ARE['returns'].kurt()
AREskew = ARE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AREbef = web.DataReader('ARE', 'yahoo', start, crashstart)
AREbef['avgreturnbefore'] = AREbef['Close'].pct_change(1)
AREbef['Cumulative Return Before Crash'] = (1 + AREbef['avgreturnbefore']).cumprod()
#period of crash
AREdur = web.DataReader('ARE', 'yahoo', crashstart, crashend)
AREdur['avgreturnduring'] = AREdur['Close'].pct_change(1)
AREdur['Cumulative Return During Crash'] = (1 + AREdur['avgreturnduring']).cumprod()
#period after crash
AREaft = web.DataReader('ARE', 'yahoo', crashend, end)
AREaft['avgreturnafter'] = AREaft['Close'].pct_change(1)
AREaft['Cumulative Return After Crash'] = (1 + AREaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AMT = web.DataReader('AMT', 'yahoo', start, end)
AMT['returns'] = AMT['Close'].pct_change(1)
AMT['Cumulative Return'] = (1 + AMT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AMTmean = AMT['returns'].mean()
AMTvar = AMT['returns'].var()
AMTkurt = AMT['returns'].kurt()
AMTskew = AMT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AMTbef = web.DataReader('AMT', 'yahoo', start, crashstart)
AMTbef['avgreturnbefore'] = AMTbef['Close'].pct_change(1)
AMTbef['Cumulative Return Before Crash'] = (1 + AMTbef['avgreturnbefore']).cumprod()
#period of crash
AMTdur = web.DataReader('AMT', 'yahoo', crashstart, crashend)
AMTdur['avgreturnduring'] = AMTdur['Close'].pct_change(1)
AMTdur['Cumulative Return During Crash'] = (1 + AMTdur['avgreturnduring']).cumprod()
#period after crash
AMTaft = web.DataReader('AMT', 'yahoo', crashend, end)
AMTaft['avgreturnafter'] = AMTaft['Close'].pct_change(1)
AMTaft['Cumulative Return After Crash'] = (1 + AMTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AIV = web.DataReader('AIV', 'yahoo', start, end)
AIV['returns'] = AIV['Close'].pct_change(1)
AIV['Cumulative Return'] = (1 + AIV['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AIVmean = AIV['returns'].mean()
AIVvar = AIV['returns'].var()
AIVkurt = AIV['returns'].kurt()
AIVskew = AIV['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AIVbef = web.DataReader('AIV', 'yahoo', start, crashstart)
AIVbef['avgreturnbefore'] = AIVbef['Close'].pct_change(1)
AIVbef['Cumulative Return Before Crash'] = (1 + AIVbef['avgreturnbefore']).cumprod()
#period of crash
AIVdur = web.DataReader('AIV', 'yahoo', crashstart, crashend)
AIVdur['avgreturnduring'] = AIVdur['Close'].pct_change(1)
AIVdur['Cumulative Return During Crash'] = (1 + AIVdur['avgreturnduring']).cumprod()
#period after crash
AIVaft = web.DataReader('AIV', 'yahoo', crashend, end)
AIVaft['avgreturnafter'] = AIVaft['Close'].pct_change(1)
AIVaft['Cumulative Return After Crash'] = (1 + AIVaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
AVB = web.DataReader('AVB', 'yahoo', start, end)
AVB['returns'] = AVB['Close'].pct_change(1)
AVB['Cumulative Return'] = (1 + AVB['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
AVBmean = AVB['returns'].mean()
AVBvar = AVB['returns'].var()
AVBkurt = AVB['returns'].kurt()
AVBskew = AVB['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
AVBbef = web.DataReader('AVB', 'yahoo', start, crashstart)
AVBbef['avgreturnbefore'] = AVBbef['Close'].pct_change(1)
AVBbef['Cumulative Return Before Crash'] = (1 + AVBbef['avgreturnbefore']).cumprod()
#period of crash
AVBdur = web.DataReader('AVB', 'yahoo', crashstart, crashend)
AVBdur['avgreturnduring'] = AVBdur['Close'].pct_change(1)
AVBdur['Cumulative Return During Crash'] = (1 + AVBdur['avgreturnduring']).cumprod()
#period after crash
AVBaft = web.DataReader('AVB', 'yahoo', crashend, end)
AVBaft['avgreturnafter'] = AVBaft['Close'].pct_change(1)
AVBaft['Cumulative Return After Crash'] = (1 + AVBaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
BXP = web.DataReader('BXP', 'yahoo', start, end)
BXP['returns'] = BXP['Close'].pct_change(1)
BXP['Cumulative Return'] = (1 + BXP['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
BXPmean = BXP['returns'].mean()
BXPvar = BXP['returns'].var()
BXPkurt = BXP['returns'].kurt()
BXPskew = BXP['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
BXPbef = web.DataReader('BXP', 'yahoo', start, crashstart)
BXPbef['avgreturnbefore'] = BXPbef['Close'].pct_change(1)
BXPbef['Cumulative Return Before Crash'] = (1 + BXPbef['avgreturnbefore']).cumprod()
#period of crash
BXPdur = web.DataReader('BXP', 'yahoo', crashstart, crashend)
BXPdur['avgreturnduring'] = BXPdur['Close'].pct_change(1)
BXPdur['Cumulative Return During Crash'] = (1 + BXPdur['avgreturnduring']).cumprod()
#period after crash
BXPaft = web.DataReader('BXP', 'yahoo', crashend, end)
BXPaft['avgreturnafter'] = BXPaft['Close'].pct_change(1)
BXPaft['Cumulative Return After Crash'] = (1 + BXPaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CBRE = web.DataReader('CBRE', 'yahoo', start, end)
CBRE['returns'] = CBRE['Close'].pct_change(1)
CBRE['Cumulative Return'] = (1 + CBRE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CBREmean = CBRE['returns'].mean()
CBREvar = CBRE['returns'].var()
CBREkurt = CBRE['returns'].kurt()
CBREskew = CBRE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CBREbef = web.DataReader('CBRE', 'yahoo', start, crashstart)
CBREbef['avgreturnbefore'] = CBREbef['Close'].pct_change(1)
CBREbef['Cumulative Return Before Crash'] = (1 + CBREbef['avgreturnbefore']).cumprod()
#period of crash
CBREdur = web.DataReader('CBRE', 'yahoo', crashstart, crashend)
CBREdur['avgreturnduring'] = CBREdur['Close'].pct_change(1)
CBREdur['Cumulative Return During Crash'] = (1 + CBREdur['avgreturnduring']).cumprod()
#period after crash
CBREaft = web.DataReader('CBRE', 'yahoo', crashend, end)
CBREaft['avgreturnafter'] = CBREaft['Close'].pct_change(1)
CBREaft['Cumulative Return After Crash'] = (1 + CBREaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
CCI = web.DataReader('CCI', 'yahoo', start, end)
CCI['returns'] = CCI['Close'].pct_change(1)
CCI['Cumulative Return'] = (1 + CCI['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
CCImean = CCI['returns'].mean()
CCIvar = CCI['returns'].var()
CCIkurt = CCI['returns'].kurt()
CCIskew = CCI['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
CCIbef = web.DataReader('CCI', 'yahoo', start, crashstart)
CCIbef['avgreturnbefore'] = CCIbef['Close'].pct_change(1)
CCIbef['Cumulative Return Before Crash'] = (1 + CCIbef['avgreturnbefore']).cumprod()
#period of crash
CCIdur = web.DataReader('CCI', 'yahoo', crashstart, crashend)
CCIdur['avgreturnduring'] = CCIdur['Close'].pct_change(1)
CCIdur['Cumulative Return During Crash'] = (1 + CCIdur['avgreturnduring']).cumprod()
#period after crash
CCIaft = web.DataReader('CCI', 'yahoo', crashend, end)
CCIaft['avgreturnafter'] = CCIaft['Close'].pct_change(1)
CCIaft['Cumulative Return After Crash'] = (1 + CCIaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DLR = web.DataReader('DLR', 'yahoo', start, end)
DLR['returns'] = DLR['Close'].pct_change(1)
DLR['Cumulative Return'] = (1 + DLR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DLRmean = DLR['returns'].mean()
DLRvar = DLR['returns'].var()
DLRkurt = DLR['returns'].kurt()
DLRskew = DLR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DLRbef = web.DataReader('DLR', 'yahoo', start, crashstart)
DLRbef['avgreturnbefore'] = DLRbef['Close'].pct_change(1)
DLRbef['Cumulative Return Before Crash'] = (1 + DLRbef['avgreturnbefore']).cumprod()
#period of crash
DLRdur = web.DataReader('DLR', 'yahoo', crashstart, crashend)
DLRdur['avgreturnduring'] = DLRdur['Close'].pct_change(1)
DLRdur['Cumulative Return During Crash'] = (1 + DLRdur['avgreturnduring']).cumprod()
#period after crash
DLRaft = web.DataReader('DLR', 'yahoo', crashend, end)
DLRaft['avgreturnafter'] = DLRaft['Close'].pct_change(1)
DLRaft['Cumulative Return After Crash'] = (1 + DLRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
DRE = web.DataReader('DRE', 'yahoo', start, end)
DRE['returns'] = DRE['Close'].pct_change(1)
DRE['Cumulative Return'] = (1 + DRE['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
DREmean = DRE['returns'].mean()
DREvar = DRE['returns'].var()
DREkurt = DRE['returns'].kurt()
DREskew = DRE['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
DREbef = web.DataReader('DRE', 'yahoo', start, crashstart)
DREbef['avgreturnbefore'] = DREbef['Close'].pct_change(1)
DREbef['Cumulative Return Before Crash'] = (1 + DREbef['avgreturnbefore']).cumprod()
#period of crash
DREdur = web.DataReader('DRE', 'yahoo', crashstart, crashend)
DREdur['avgreturnduring'] = DREdur['Close'].pct_change(1)
DREdur['Cumulative Return During Crash'] = (1 + DREdur['avgreturnduring']).cumprod()
#period after crash
DREaft = web.DataReader('DRE', 'yahoo', crashend, end)
DREaft['avgreturnafter'] = DREaft['Close'].pct_change(1)
DREaft['Cumulative Return After Crash'] = (1 + DREaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EQIX = web.DataReader('EQIX', 'yahoo', start, end)
EQIX['returns'] = EQIX['Close'].pct_change(1)
EQIX['Cumulative Return'] = (1 + EQIX['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EQIXmean = EQIX['returns'].mean()
EQIXvar = EQIX['returns'].var()
EQIXkurt = EQIX['returns'].kurt()
EQIXskew = EQIX['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EQIXbef = web.DataReader('EQIX', 'yahoo', start, crashstart)
EQIXbef['avgreturnbefore'] = EQIXbef['Close'].pct_change(1)
EQIXbef['Cumulative Return Before Crash'] = (1 + EQIXbef['avgreturnbefore']).cumprod()
#period of crash
EQIXdur = web.DataReader('EQIX', 'yahoo', crashstart, crashend)
EQIXdur['avgreturnduring'] = EQIXdur['Close'].pct_change(1)
EQIXdur['Cumulative Return During Crash'] = (1 + EQIXdur['avgreturnduring']).cumprod()
#period after crash
EQIXaft = web.DataReader('EQIX', 'yahoo', crashend, end)
EQIXaft['avgreturnafter'] = EQIXaft['Close'].pct_change(1)
EQIXaft['Cumulative Return After Crash'] = (1 + EQIXaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EQR = web.DataReader('EQR', 'yahoo', start, end)
EQR['returns'] = EQR['Close'].pct_change(1)
EQR['Cumulative Return'] = (1 + EQR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EQRmean = EQR['returns'].mean()
EQRvar = EQR['returns'].var()
EQRkurt = EQR['returns'].kurt()
EQRskew = EQR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EQRbef = web.DataReader('EQR', 'yahoo', start, crashstart)
EQRbef['avgreturnbefore'] = EQRbef['Close'].pct_change(1)
EQRbef['Cumulative Return Before Crash'] = (1 + EQRbef['avgreturnbefore']).cumprod()
#period of crash
EQRdur = web.DataReader('EQR', 'yahoo', crashstart, crashend)
EQRdur['avgreturnduring'] = EQRdur['Close'].pct_change(1)
EQRdur['Cumulative Return During Crash'] = (1 + EQRdur['avgreturnduring']).cumprod()
#period after crash
EQRaft = web.DataReader('EQR', 'yahoo', crashend, end)
EQRaft['avgreturnafter'] = EQRaft['Close'].pct_change(1)
EQRaft['Cumulative Return After Crash'] = (1 + EQRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
ESS = web.DataReader('ESS', 'yahoo', start, end)
ESS['returns'] = ESS['Close'].pct_change(1)
ESS['Cumulative Return'] = (1 + ESS['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
ESSmean = ESS['returns'].mean()
ESSvar = ESS['returns'].var()
ESSkurt = ESS['returns'].kurt()
ESSskew = ESS['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
ESSbef = web.DataReader('ESS', 'yahoo', start, crashstart)
ESSbef['avgreturnbefore'] = ESSbef['Close'].pct_change(1)
ESSbef['Cumulative Return Before Crash'] = (1 + ESSbef['avgreturnbefore']).cumprod()
#period of crash
ESSdur = web.DataReader('ESS', 'yahoo', crashstart, crashend)
ESSdur['avgreturnduring'] = ESSdur['Close'].pct_change(1)
ESSdur['Cumulative Return During Crash'] = (1 + ESSdur['avgreturnduring']).cumprod()
#period after crash
ESSaft = web.DataReader('ESS', 'yahoo', crashend, end)
ESSaft['avgreturnafter'] = ESSaft['Close'].pct_change(1)
ESSaft['Cumulative Return After Crash'] = (1 + ESSaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
EXR = web.DataReader('EXR', 'yahoo', start, end)
EXR['returns'] = EXR['Close'].pct_change(1)
EXR['Cumulative Return'] = (1 + EXR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
EXRmean = EXR['returns'].mean()
EXRvar = EXR['returns'].var()
EXRkurt = EXR['returns'].kurt()
EXRskew = EXR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
EXRbef = web.DataReader('EXR', 'yahoo', start, crashstart)
EXRbef['avgreturnbefore'] = EXRbef['Close'].pct_change(1)
EXRbef['Cumulative Return Before Crash'] = (1 + EXRbef['avgreturnbefore']).cumprod()
#period of crash
EXRdur = web.DataReader('EXR', 'yahoo', crashstart, crashend)
EXRdur['avgreturnduring'] = EXRdur['Close'].pct_change(1)
EXRdur['Cumulative Return During Crash'] = (1 + EXRdur['avgreturnduring']).cumprod()
#period after crash
EXRaft = web.DataReader('EXR', 'yahoo', crashend, end)
EXRaft['avgreturnafter'] = EXRaft['Close'].pct_change(1)
EXRaft['Cumulative Return After Crash'] = (1 + EXRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
FRT = web.DataReader('FRT', 'yahoo', start, end)
FRT['returns'] = FRT['Close'].pct_change(1)
FRT['Cumulative Return'] = (1 + FRT['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
FRTmean = FRT['returns'].mean()
FRTvar = FRT['returns'].var()
FRTkurt = FRT['returns'].kurt()
FRTskew = FRT['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
FRTbef = web.DataReader('FRT', 'yahoo', start, crashstart)
FRTbef['avgreturnbefore'] = FRTbef['Close'].pct_change(1)
FRTbef['Cumulative Return Before Crash'] = (1 + FRTbef['avgreturnbefore']).cumprod()
#period of crash
FRTdur = web.DataReader('FRT', 'yahoo', crashstart, crashend)
FRTdur['avgreturnduring'] = FRTdur['Close'].pct_change(1)
FRTdur['Cumulative Return During Crash'] = (1 + FRTdur['avgreturnduring']).cumprod()
#period after crash
FRTaft = web.DataReader('FRT', 'yahoo', crashend, end)
FRTaft['avgreturnafter'] = FRTaft['Close'].pct_change(1)
FRTaft['Cumulative Return After Crash'] = (1 + FRTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PEAK = web.DataReader('PEAK', 'yahoo', start, end)
PEAK['returns'] = PEAK['Close'].pct_change(1)
PEAK['Cumulative Return'] = (1 + PEAK['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PEAKmean = PEAK['returns'].mean()
PEAKvar = PEAK['returns'].var()
PEAKkurt = PEAK['returns'].kurt()
PEAKskew = PEAK['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PEAKbef = web.DataReader('PEAK', 'yahoo', start, crashstart)
PEAKbef['avgreturnbefore'] = PEAKbef['Close'].pct_change(1)
PEAKbef['Cumulative Return Before Crash'] = (1 + PEAKbef['avgreturnbefore']).cumprod()
#period of crash
PEAKdur = web.DataReader('PEAK', 'yahoo', crashstart, crashend)
PEAKdur['avgreturnduring'] = PEAKdur['Close'].pct_change(1)
PEAKdur['Cumulative Return During Crash'] = (1 + PEAKdur['avgreturnduring']).cumprod()
#period after crash
PEAKaft = web.DataReader('PEAK', 'yahoo', crashend, end)
PEAKaft['avgreturnafter'] = PEAKaft['Close'].pct_change(1)
PEAKaft['Cumulative Return After Crash'] = (1 + PEAKaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
HST = web.DataReader('HST', 'yahoo', start, end)
HST['returns'] = HST['Close'].pct_change(1)
HST['Cumulative Return'] = (1 + HST['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
HSTmean = HST['returns'].mean()
HSTvar = HST['returns'].var()
HSTkurt = HST['returns'].kurt()
HSTskew = HST['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
HSTbef = web.DataReader('HST', 'yahoo', start, crashstart)
HSTbef['avgreturnbefore'] = HSTbef['Close'].pct_change(1)
HSTbef['Cumulative Return Before Crash'] = (1 + HSTbef['avgreturnbefore']).cumprod()
#period of crash
HSTdur = web.DataReader('HST', 'yahoo', crashstart, crashend)
HSTdur['avgreturnduring'] = HSTdur['Close'].pct_change(1)
HSTdur['Cumulative Return During Crash'] = (1 + HSTdur['avgreturnduring']).cumprod()
#period after crash
HSTaft = web.DataReader('HST', 'yahoo', crashend, end)
HSTaft['avgreturnafter'] = HSTaft['Close'].pct_change(1)
HSTaft['Cumulative Return After Crash'] = (1 + HSTaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
IRM = web.DataReader('IRM', 'yahoo', start, end)
IRM['returns'] = IRM['Close'].pct_change(1)
IRM['Cumulative Return'] = (1 + IRM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
IRMmean = IRM['returns'].mean()
IRMvar = IRM['returns'].var()
IRMkurt = IRM['returns'].kurt()
IRMskew = IRM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
IRMbef = web.DataReader('IRM', 'yahoo', start, crashstart)
IRMbef['avgreturnbefore'] = IRMbef['Close'].pct_change(1)
IRMbef['Cumulative Return Before Crash'] = (1 + IRMbef['avgreturnbefore']).cumprod()
#period of crash
IRMdur = web.DataReader('IRM', 'yahoo', crashstart, crashend)
IRMdur['avgreturnduring'] = IRMdur['Close'].pct_change(1)
IRMdur['Cumulative Return During Crash'] = (1 + IRMdur['avgreturnduring']).cumprod()
#period after crash
IRMaft = web.DataReader('IRM', 'yahoo', crashend, end)
IRMaft['avgreturnafter'] = IRMaft['Close'].pct_change(1)
IRMaft['Cumulative Return After Crash'] = (1 + IRMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
KIM = web.DataReader('KIM', 'yahoo', start, end)
KIM['returns'] = KIM['Close'].pct_change(1)
KIM['Cumulative Return'] = (1 + KIM['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
KIMmean = KIM['returns'].mean()
KIMvar = KIM['returns'].var()
KIMkurt = KIM['returns'].kurt()
KIMskew = KIM['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
KIMbef = web.DataReader('KIM', 'yahoo', start, crashstart)
KIMbef['avgreturnbefore'] = KIMbef['Close'].pct_change(1)
KIMbef['Cumulative Return Before Crash'] = (1 + KIMbef['avgreturnbefore']).cumprod()
#period of crash
KIMdur = web.DataReader('KIM', 'yahoo', crashstart, crashend)
KIMdur['avgreturnduring'] = KIMdur['Close'].pct_change(1)
KIMdur['Cumulative Return During Crash'] = (1 + KIMdur['avgreturnduring']).cumprod()
#period after crash
KIMaft = web.DataReader('KIM', 'yahoo', crashend, end)
KIMaft['avgreturnafter'] = KIMaft['Close'].pct_change(1)
KIMaft['Cumulative Return After Crash'] = (1 + KIMaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
MAA = web.DataReader('MAA', 'yahoo', start, end)
MAA['returns'] = MAA['Close'].pct_change(1)
MAA['Cumulative Return'] = (1 + MAA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
MAAmean = MAA['returns'].mean()
MAAvar = MAA['returns'].var()
MAAkurt = MAA['returns'].kurt()
MAAskew = MAA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
MAAbef = web.DataReader('MAA', 'yahoo', start, crashstart)
MAAbef['avgreturnbefore'] = MAAbef['Close'].pct_change(1)
MAAbef['Cumulative Return Before Crash'] = (1 + MAAbef['avgreturnbefore']).cumprod()
#period of crash
MAAdur = web.DataReader('MAA', 'yahoo', crashstart, crashend)
MAAdur['avgreturnduring'] = MAAdur['Close'].pct_change(1)
MAAdur['Cumulative Return During Crash'] = (1 + MAAdur['avgreturnduring']).cumprod()
#period after crash
MAAaft = web.DataReader('MAA', 'yahoo', crashend, end)
MAAaft['avgreturnafter'] = MAAaft['Close'].pct_change(1)
MAAaft['Cumulative Return After Crash'] = (1 + MAAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PLD = web.DataReader('PLD', 'yahoo', start, end)
PLD['returns'] = PLD['Close'].pct_change(1)
PLD['Cumulative Return'] = (1 + PLD['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PLDmean = PLD['returns'].mean()
PLDvar = PLD['returns'].var()
PLDkurt = PLD['returns'].kurt()
PLDskew = PLD['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PLDbef = web.DataReader('PLD', 'yahoo', start, crashstart)
PLDbef['avgreturnbefore'] = PLDbef['Close'].pct_change(1)
PLDbef['Cumulative Return Before Crash'] = (1 + PLDbef['avgreturnbefore']).cumprod()
#period of crash
PLDdur = web.DataReader('PLD', 'yahoo', crashstart, crashend)
PLDdur['avgreturnduring'] = PLDdur['Close'].pct_change(1)
PLDdur['Cumulative Return During Crash'] = (1 + PLDdur['avgreturnduring']).cumprod()
#period after crash
PLDaft = web.DataReader('PLD', 'yahoo', crashend, end)
PLDaft['avgreturnafter'] = PLDaft['Close'].pct_change(1)
PLDaft['Cumulative Return After Crash'] = (1 + PLDaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
PSA = web.DataReader('PSA', 'yahoo', start, end)
PSA['returns'] = PSA['Close'].pct_change(1)
PSA['Cumulative Return'] = (1 + PSA['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
PSAmean = PSA['returns'].mean()
PSAvar = PSA['returns'].var()
PSAkurt = PSA['returns'].kurt()
PSAskew = PSA['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
PSAbef = web.DataReader('PSA', 'yahoo', start, crashstart)
PSAbef['avgreturnbefore'] = PSAbef['Close'].pct_change(1)
PSAbef['Cumulative Return Before Crash'] = (1 + PSAbef['avgreturnbefore']).cumprod()
#period of crash
PSAdur = web.DataReader('PSA', 'yahoo', crashstart, crashend)
PSAdur['avgreturnduring'] = PSAdur['Close'].pct_change(1)
PSAdur['Cumulative Return During Crash'] = (1 + PSAdur['avgreturnduring']).cumprod()
#period after crash
PSAaft = web.DataReader('PSA', 'yahoo', crashend, end)
PSAaft['avgreturnafter'] = PSAaft['Close'].pct_change(1)
PSAaft['Cumulative Return After Crash'] = (1 + PSAaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
O = web.DataReader('O', 'yahoo', start, end)
O['returns'] = O['Close'].pct_change(1)
O['Cumulative Return'] = (1 + O['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
Omean = O['returns'].mean()
Ovar = O['returns'].var()
Okurt = O['returns'].kurt()
Oskew = O['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
Obef = web.DataReader('O', 'yahoo', start, crashstart)
Obef['avgreturnbefore'] = Obef['Close'].pct_change(1)
Obef['Cumulative Return Before Crash'] = (1 + Obef['avgreturnbefore']).cumprod()
#period of crash
Odur = web.DataReader('O', 'yahoo', crashstart, crashend)
Odur['avgreturnduring'] = Odur['Close'].pct_change(1)
Odur['Cumulative Return During Crash'] = (1 + Odur['avgreturnduring']).cumprod()
#period after crash
Oaft = web.DataReader('O', 'yahoo', crashend, end)
Oaft['avgreturnafter'] = Oaft['Close'].pct_change(1)
Oaft['Cumulative Return After Crash'] = (1 + Oaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
REG = web.DataReader('REG', 'yahoo', start, end)
REG['returns'] = REG['Close'].pct_change(1)
REG['Cumulative Return'] = (1 + REG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
REGmean = REG['returns'].mean()
REGvar = REG['returns'].var()
REGkurt = REG['returns'].kurt()
REGskew = REG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
REGbef = web.DataReader('REG', 'yahoo', start, crashstart)
REGbef['avgreturnbefore'] = REGbef['Close'].pct_change(1)
REGbef['Cumulative Return Before Crash'] = (1 + REGbef['avgreturnbefore']).cumprod()
#period of crash
REGdur = web.DataReader('REG', 'yahoo', crashstart, crashend)
REGdur['avgreturnduring'] = REGdur['Close'].pct_change(1)
REGdur['Cumulative Return During Crash'] = (1 + REGdur['avgreturnduring']).cumprod()
#period after crash
REGaft = web.DataReader('REG', 'yahoo', crashend, end)
REGaft['avgreturnafter'] = REGaft['Close'].pct_change(1)
REGaft['Cumulative Return After Crash'] = (1 + REGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SBAC = web.DataReader('SBAC', 'yahoo', start, end)
SBAC['returns'] = SBAC['Close'].pct_change(1)
SBAC['Cumulative Return'] = (1 + SBAC['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SBACmean = SBAC['returns'].mean()
SBACvar = SBAC['returns'].var()
SBACkurt = SBAC['returns'].kurt()
SBACskew = SBAC['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SBACbef = web.DataReader('SBAC', 'yahoo', start, crashstart)
SBACbef['avgreturnbefore'] = SBACbef['Close'].pct_change(1)
SBACbef['Cumulative Return Before Crash'] = (1 + SBACbef['avgreturnbefore']).cumprod()
#period of crash
SBACdur = web.DataReader('SBAC', 'yahoo', crashstart, crashend)
SBACdur['avgreturnduring'] = SBACdur['Close'].pct_change(1)
SBACdur['Cumulative Return During Crash'] = (1 + SBACdur['avgreturnduring']).cumprod()
#period after crash
SBACaft = web.DataReader('SBAC', 'yahoo', crashend, end)
SBACaft['avgreturnafter'] = SBACaft['Close'].pct_change(1)
SBACaft['Cumulative Return After Crash'] = (1 + SBACaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SPG = web.DataReader('SPG', 'yahoo', start, end)
SPG['returns'] = SPG['Close'].pct_change(1)
SPG['Cumulative Return'] = (1 + SPG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SPGmean = SPG['returns'].mean()
SPGvar = SPG['returns'].var()
SPGkurt = SPG['returns'].kurt()
SPGskew = SPG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SPGbef = web.DataReader('SPG', 'yahoo', start, crashstart)
SPGbef['avgreturnbefore'] = SPGbef['Close'].pct_change(1)
SPGbef['Cumulative Return Before Crash'] = (1 + SPGbef['avgreturnbefore']).cumprod()
#period of crash
SPGdur = web.DataReader('SPG', 'yahoo', crashstart, crashend)
SPGdur['avgreturnduring'] = SPGdur['Close'].pct_change(1)
SPGdur['Cumulative Return During Crash'] = (1 + SPGdur['avgreturnduring']).cumprod()
#period after crash
SPGaft = web.DataReader('SPG', 'yahoo', crashend, end)
SPGaft['avgreturnafter'] = SPGaft['Close'].pct_change(1)
SPGaft['Cumulative Return After Crash'] = (1 + SPGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
SLG = web.DataReader('SLG', 'yahoo', start, end)
SLG['returns'] = SLG['Close'].pct_change(1)
SLG['Cumulative Return'] = (1 + SLG['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
SLGmean = SLG['returns'].mean()
SLGvar = SLG['returns'].var()
SLGkurt = SLG['returns'].kurt()
SLGskew = SLG['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
SLGbef = web.DataReader('SLG', 'yahoo', start, crashstart)
SLGbef['avgreturnbefore'] = SLGbef['Close'].pct_change(1)
SLGbef['Cumulative Return Before Crash'] = (1 + SLGbef['avgreturnbefore']).cumprod()
#period of crash
SLGdur = web.DataReader('SLG', 'yahoo', crashstart, crashend)
SLGdur['avgreturnduring'] = SLGdur['Close'].pct_change(1)
SLGdur['Cumulative Return During Crash'] = (1 + SLGdur['avgreturnduring']).cumprod()
#period after crash
SLGaft = web.DataReader('SLG', 'yahoo', crashend, end)
SLGaft['avgreturnafter'] = SLGaft['Close'].pct_change(1)
SLGaft['Cumulative Return After Crash'] = (1 + SLGaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
UDR = web.DataReader('UDR', 'yahoo', start, end)
UDR['returns'] = UDR['Close'].pct_change(1)
UDR['Cumulative Return'] = (1 + UDR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
UDRmean = UDR['returns'].mean()
UDRvar = UDR['returns'].var()
UDRkurt = UDR['returns'].kurt()
UDRskew = UDR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
UDRbef = web.DataReader('UDR', 'yahoo', start, crashstart)
UDRbef['avgreturnbefore'] = UDRbef['Close'].pct_change(1)
UDRbef['Cumulative Return Before Crash'] = (1 + UDRbef['avgreturnbefore']).cumprod()
#period of crash
UDRdur = web.DataReader('UDR', 'yahoo', crashstart, crashend)
UDRdur['avgreturnduring'] = UDRdur['Close'].pct_change(1)
UDRdur['Cumulative Return During Crash'] = (1 + UDRdur['avgreturnduring']).cumprod()
#period after crash
UDRaft = web.DataReader('UDR', 'yahoo', crashend, end)
UDRaft['avgreturnafter'] = UDRaft['Close'].pct_change(1)
UDRaft['Cumulative Return After Crash'] = (1 + UDRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
VTR = web.DataReader('VTR', 'yahoo', start, end)
VTR['returns'] = VTR['Close'].pct_change(1)
VTR['Cumulative Return'] = (1 + VTR['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
VTRmean = VTR['returns'].mean()
VTRvar = VTR['returns'].var()
VTRkurt = VTR['returns'].kurt()
VTRskew = VTR['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
VTRbef = web.DataReader('VTR', 'yahoo', start, crashstart)
VTRbef['avgreturnbefore'] = VTRbef['Close'].pct_change(1)
VTRbef['Cumulative Return Before Crash'] = (1 + VTRbef['avgreturnbefore']).cumprod()
#period of crash
VTRdur = web.DataReader('VTR', 'yahoo', crashstart, crashend)
VTRdur['avgreturnduring'] = VTRdur['Close'].pct_change(1)
VTRdur['Cumulative Return During Crash'] = (1 + VTRdur['avgreturnduring']).cumprod()
#period after crash
VTRaft = web.DataReader('VTR', 'yahoo', crashend, end)
VTRaft['avgreturnafter'] = VTRaft['Close'].pct_change(1)
VTRaft['Cumulative Return After Crash'] = (1 + VTRaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
VNO = web.DataReader('VNO', 'yahoo', start, end)
VNO['returns'] = VNO['Close'].pct_change(1)
VNO['Cumulative Return'] = (1 + VNO['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
VNOmean = VNO['returns'].mean()
VNOvar = VNO['returns'].var()
VNOkurt = VNO['returns'].kurt()
VNOskew = VNO['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
VNObef = web.DataReader('VNO', 'yahoo', start, crashstart)
VNObef['avgreturnbefore'] = VNObef['Close'].pct_change(1)
VNObef['Cumulative Return Before Crash'] = (1 + VNObef['avgreturnbefore']).cumprod()
#period of crash
VNOdur = web.DataReader('VNO', 'yahoo', crashstart, crashend)
VNOdur['avgreturnduring'] = VNOdur['Close'].pct_change(1)
VNOdur['Cumulative Return During Crash'] = (1 + VNOdur['avgreturnduring']).cumprod()
#period after crash
VNOaft = web.DataReader('VNO', 'yahoo', crashend, end)
VNOaft['avgreturnafter'] = VNOaft['Close'].pct_change(1)
VNOaft['Cumulative Return After Crash'] = (1 + VNOaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WELL = web.DataReader('WELL', 'yahoo', start, end)
WELL['returns'] = WELL['Close'].pct_change(1)
WELL['Cumulative Return'] = (1 + WELL['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WELLmean = WELL['returns'].mean()
WELLvar = WELL['returns'].var()
WELLkurt = WELL['returns'].kurt()
WELLskew = WELL['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WELLbef = web.DataReader('WELL', 'yahoo', start, crashstart)
WELLbef['avgreturnbefore'] = WELLbef['Close'].pct_change(1)
WELLbef['Cumulative Return Before Crash'] = (1 + WELLbef['avgreturnbefore']).cumprod()
#period of crash
WELLdur = web.DataReader('WELL', 'yahoo', crashstart, crashend)
WELLdur['avgreturnduring'] = WELLdur['Close'].pct_change(1)
WELLdur['Cumulative Return During Crash'] = (1 + WELLdur['avgreturnduring']).cumprod()
#period after crash
WELLaft = web.DataReader('WELL', 'yahoo', crashend, end)
WELLaft['avgreturnafter'] = WELLaft['Close'].pct_change(1)
WELLaft['Cumulative Return After Crash'] = (1 + WELLaft['avgreturnafter']).cumprod()
start = datetime.datetime(2019, 12, 4)
end = datetime.datetime(2020, 6, 5)
WY = web.DataReader('WY', 'yahoo', start, end)
WY['returns'] = WY['Close'].pct_change(1)
WY['Cumulative Return'] = (1 + WY['returns']).cumprod()
#Mean, variance, Kurtosis and Skew
WYmean = WY['returns'].mean()
WYvar = WY['returns'].var()
WYkurt = WY['returns'].kurt()
WYskew = WY['returns'].skew()
#period before crash
crashstart = datetime.datetime(2020,2,20)
crashend = datetime.datetime(2020,3,23)
WYbef = web.DataReader('WY', 'yahoo', start, crashstart)
WYbef['avgreturnbefore'] = WYbef['Close'].pct_change(1)
WYbef['Cumulative Return Before Crash'] = (1 + WYbef['avgreturnbefore']).cumprod()
#period of crash
WYdur = web.DataReader('WY', 'yahoo', crashstart, crashend)
WYdur['avgreturnduring'] = WYdur['Close'].pct_change(1)
WYdur['Cumulative Return During Crash'] = (1 + WYdur['avgreturnduring']).cumprod()
#period after crash
WYaft = web.DataReader('WY', 'yahoo', crashend, end)
WYaft['avgreturnafter'] = WYaft['Close'].pct_change(1)
WYaft['Cumulative Return After Crash'] = (1 + WYaft['avgreturnafter']).cumprod()
#KDE Plot for Real Estate Sector
sp['returns'].plot(kind = 'kde', label ='S&P 500', alpha=0.5)
ARE['returns'].plot(kind = 'kde', label ='ARE', figsize = (10,8), alpha=0.5, title = 'KDE of Real Estate Stocks')
AMT['returns'].plot(kind = 'kde', label ='AMT', alpha=0.5)
AIV['returns'].plot(kind = 'kde', label ='AIV', alpha=0.5)
AVB['returns'].plot(kind = 'kde', label ='AVB', alpha=0.5)
BXP['returns'].plot(kind = 'kde', label ='BXP', alpha=0.5)
CBRE['returns'].plot(kind = 'kde', label ='CBRE', alpha=0.5)
CCI['returns'].plot(kind = 'kde', label ='CCI', alpha=0.5)
DLR['returns'].plot(kind = 'kde', label ='DLR', alpha=0.5)
DRE['returns'].plot(kind = 'kde', label ='DRE', alpha=0.5)
EQIX['returns'].plot(kind = 'kde', label ='EQIX', alpha=0.5)
EQR['returns'].plot(kind = 'kde', label ='EQR', alpha=0.5)
ESS['returns'].plot(kind = 'kde', label ='ESS', alpha=0.5)
EXR['returns'].plot(kind = 'kde', label ='EXR', alpha=0.5)
FRT['returns'].plot(kind = 'kde', label ='FRT', alpha=0.5)
PEAK['returns'].plot(kind = 'kde', label = 'PEAK', alpha=0.5)
HST['returns'].plot(kind = 'kde', label ='HST', alpha=0.5)
IRM['returns'].plot(kind = 'kde', label ='IRM', alpha=0.5)
KIM['returns'].plot(kind = 'kde', label ='KIM', alpha=0.5)
MAA['returns'].plot(kind = 'kde', label ='MAA', alpha=0.5)
PLD['returns'].plot(kind = 'kde', label ='PLD', alpha=0.5)
PSA['returns'].plot(kind = 'kde', label ='PSA', alpha=0.5)
O['returns'].plot(kind = 'kde', label ='O', alpha=0.5)
REG['returns'].plot(kind = 'kde', label ='REG', alpha=0.5)
SBAC['returns'].plot(kind = 'kde', label ='SBAC', alpha=0.5)
SPG['returns'].plot(kind = 'kde', label ='SPG', alpha=0.5)
SLG['returns'].plot(kind = 'kde', label ='SLG', alpha=0.5)
UDR['returns'].plot(kind = 'kde', label ='UDR', alpha=0.5)
VTR['returns'].plot(kind = 'kde', label ='VTR', alpha=0.5)
VNO['returns'].plot(kind = 'kde', label ='VNO', alpha=0.5)
WELL['returns'].plot(kind = 'kde', label ='WELL', alpha=0.5)
WY['returns'].plot(kind = 'kde', label ='WY', alpha=0.5)
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Boxplots comparing returns for Real Estate Sector
box_df = pd.concat([sp['returns'],ARE['returns'],AMT['returns'],AIV['returns'],AVB['returns'],BXP['returns'],CBRE['returns'],CCI['returns'],DLR['returns'],DRE['returns'],EQIX['returns'],EQR['returns'],ESS['returns'],EXR['returns'],FRT['returns'],PEAK['returns'],HST['returns'],IRM['returns'],KIM['returns'],MAA['returns'],PLD['returns'],PSA['returns'],O['returns'],REG['returns'],SBAC['returns'],SPG['returns'],SLG['returns'],UDR['returns'],VTR['returns'],VNO['returns'],WELL['returns'],WY['returns']], axis=1)
box_df.columns = ['S&P 500','ARE','AMT','AIV','AVB','BXP','CBRE','CCI','DLR','DRE','EQIX','EQR','ESS','EXR','FRT','PEAK','HST','IRM','KIM','MAA','PLD','PSA','O','REG','SBAC','SPG','SLG','UDR','VTR','VNO','WELL','WY']
box_df.plot(kind='box', figsize=(30,10), colormap= 'jet', title = 'Boxplots of Real Estate Sector Returns')
#Cumulative Returns of Real Estate Stocks for Whole period
sp['Cumulative Return'].plot(label="S&P 500")
ARE['Cumulative Return'].plot(label='ARE', figsize=(16,8), title = 'Cumulative Return of Real Estate Stocks')
AMT['Cumulative Return'].plot(label="AMT")
AIV['Cumulative Return'].plot(label="AIV")
AVB['Cumulative Return'].plot(label="AVB")
BXP['Cumulative Return'].plot(label="BXP")
CBRE['Cumulative Return'].plot(label="CBRE")
CCI['Cumulative Return'].plot(label="CCI")
DLR['Cumulative Return'].plot(label="DLR")
DRE['Cumulative Return'].plot(label="DRE")
EQIX['Cumulative Return'].plot(label="EQIX")
EQR['Cumulative Return'].plot(label="EQR")
ESS['Cumulative Return'].plot(label="ESS")
EXR['Cumulative Return'].plot(label="EXR")
FRT['Cumulative Return'].plot(label="FRT")
PEAK['Cumulative Return'].plot(label="PEAK")
HST['Cumulative Return'].plot(label="HST")
IRM['Cumulative Return'].plot(label="IRM")
KIM['Cumulative Return'].plot(label="KIM")
MAA['Cumulative Return'].plot(label="MAA")
PLD['Cumulative Return'].plot(label="PLD")
PSA['Cumulative Return'].plot(label="PSA")
O['Cumulative Return'].plot(label="O")
REG['Cumulative Return'].plot(label="REG")
SBAC['Cumulative Return'].plot(label="SBAC")
SPG['Cumulative Return'].plot(label="SPG")
SLG['Cumulative Return'].plot(label="SLG")
UDR['Cumulative Return'].plot(label="UDR")
VTR['Cumulative Return'].plot(label="VTR")
VNO['Cumulative Return'].plot(label="VNO")
WELL['Cumulative Return'].plot(label="WELL")
WY['Cumulative Return'].plot(label="WY")
plt.legend(bbox_to_anchor=(1.2,1), loc="upper right");
#Sorting by Cumulative Return
cumret = {'Cumulative Returns 12/4-6/5': [sp['Cumulative Return'].iloc[-1],ARE['Cumulative Return'].iloc[-1],AMT['Cumulative Return'].iloc[-1],AIV['Cumulative Return'].iloc[-1],AVB['Cumulative Return'].iloc[-1],BXP['Cumulative Return'].iloc[-1],CBRE['Cumulative Return'].iloc[-1],CCI['Cumulative Return'].iloc[-1],DLR['Cumulative Return'].iloc[-1],DRE['Cumulative Return'].iloc[-1],EQIX['Cumulative Return'].iloc[-1],EQR['Cumulative Return'].iloc[-1],ESS['Cumulative Return'].iloc[-1],EXR['Cumulative Return'].iloc[-1],FRT['Cumulative Return'].iloc[-1],PEAK['Cumulative Return'].iloc[-1],HST['Cumulative Return'].iloc[-1],IRM['Cumulative Return'].iloc[-1],KIM['Cumulative Return'].iloc[-1],MAA['Cumulative Return'].iloc[-1],PLD['Cumulative Return'].iloc[-1],PSA['Cumulative Return'].iloc[-1],O['Cumulative Return'].iloc[-1],REG['Cumulative Return'].iloc[-1],SBAC['Cumulative Return'].iloc[-1],SPG['Cumulative Return'].iloc[-1],SLG['Cumulative Return'].iloc[-1],UDR['Cumulative Return'].iloc[-1],VTR['Cumulative Return'].iloc[-1],VNO['Cumulative Return'].iloc[-1],WELL['Cumulative Return'].iloc[-1],WY['Cumulative Return'].iloc[-1]],
'Cumulative Returns 12/4-2/20': [spbef['Cumulative Return Before Crash'].iloc[-1],AREbef['Cumulative Return Before Crash'].iloc[-1],AMTbef['Cumulative Return Before Crash'].iloc[-1],AIVbef['Cumulative Return Before Crash'].iloc[-1],AVBbef['Cumulative Return Before Crash'].iloc[-1],BXPbef['Cumulative Return Before Crash'].iloc[-1],CBREbef['Cumulative Return Before Crash'].iloc[-1],CCIbef['Cumulative Return Before Crash'].iloc[-1],DLRbef['Cumulative Return Before Crash'].iloc[-1],DREbef['Cumulative Return Before Crash'].iloc[-1],EQIXbef['Cumulative Return Before Crash'].iloc[-1],EQRbef['Cumulative Return Before Crash'].iloc[-1],ESSbef['Cumulative Return Before Crash'].iloc[-1],EXRbef['Cumulative Return Before Crash'].iloc[-1],FRTbef['Cumulative Return Before Crash'].iloc[-1],PEAKbef['Cumulative Return Before Crash'].iloc[-1],HSTbef['Cumulative Return Before Crash'].iloc[-1],IRMbef['Cumulative Return Before Crash'].iloc[-1],KIMbef['Cumulative Return Before Crash'].iloc[-1],MAAbef['Cumulative Return Before Crash'].iloc[-1],PLDbef['Cumulative Return Before Crash'].iloc[-1],PSAbef['Cumulative Return Before Crash'].iloc[-1],Obef['Cumulative Return Before Crash'].iloc[-1],REGbef['Cumulative Return Before Crash'].iloc[-1],SBACbef['Cumulative Return Before Crash'].iloc[-1],SPGbef['Cumulative Return Before Crash'].iloc[-1],SLGbef['Cumulative Return Before Crash'].iloc[-1],UDRbef['Cumulative Return Before Crash'].iloc[-1],VTRbef['Cumulative Return Before Crash'].iloc[-1],VNObef['Cumulative Return Before Crash'].iloc[-1],WELLbef['Cumulative Return Before Crash'].iloc[-1],WYbef['Cumulative Return Before Crash'].iloc[-1]],
'Cumulative Returns 2/20-3/23': [spdur['Cumulative Return During Crash'].iloc[-1],AREdur['Cumulative Return During Crash'].iloc[-1],AMTdur['Cumulative Return During Crash'].iloc[-1],AIVdur['Cumulative Return During Crash'].iloc[-1],AVBdur['Cumulative Return During Crash'].iloc[-1],BXPdur['Cumulative Return During Crash'].iloc[-1],CBREdur['Cumulative Return During Crash'].iloc[-1],CCIdur['Cumulative Return During Crash'].iloc[-1],DLRdur['Cumulative Return During Crash'].iloc[-1],DREdur['Cumulative Return During Crash'].iloc[-1],EQIXdur['Cumulative Return During Crash'].iloc[-1],EQRdur['Cumulative Return During Crash'].iloc[-1],ESSdur['Cumulative Return During Crash'].iloc[-1],EXRdur['Cumulative Return During Crash'].iloc[-1],FRTdur['Cumulative Return During Crash'].iloc[-1],PEAKdur['Cumulative Return During Crash'].iloc[-1],HSTdur['Cumulative Return During Crash'].iloc[-1],IRMdur['Cumulative Return During Crash'].iloc[-1],KIMdur['Cumulative Return During Crash'].iloc[-1],MAAdur['Cumulative Return During Crash'].iloc[-1],PLDdur['Cumulative Return During Crash'].iloc[-1],PSAdur['Cumulative Return During Crash'].iloc[-1],Odur['Cumulative Return During Crash'].iloc[-1],REGdur['Cumulative Return During Crash'].iloc[-1],SBACdur['Cumulative Return During Crash'].iloc[-1],SPGdur['Cumulative Return During Crash'].iloc[-1],SLGdur['Cumulative Return During Crash'].iloc[-1],UDRdur['Cumulative Return During Crash'].iloc[-1],VTRdur['Cumulative Return During Crash'].iloc[-1],VNOdur['Cumulative Return During Crash'].iloc[-1],WELLdur['Cumulative Return During Crash'].iloc[-1],WYdur['Cumulative Return During Crash'].iloc[-1]],
'Cumulative Returns 3/23-6/5': [spaft['Cumulative Return After Crash'].iloc[-1],AREaft['Cumulative Return After Crash'].iloc[-1],AMTaft['Cumulative Return After Crash'].iloc[-1],AIVaft['Cumulative Return After Crash'].iloc[-1],AVBaft['Cumulative Return After Crash'].iloc[-1],BXPaft['Cumulative Return After Crash'].iloc[-1],CBREaft['Cumulative Return After Crash'].iloc[-1],CCIaft['Cumulative Return After Crash'].iloc[-1],DLRaft['Cumulative Return After Crash'].iloc[-1],DREaft['Cumulative Return After Crash'].iloc[-1],EQIXaft['Cumulative Return After Crash'].iloc[-1],EQRaft['Cumulative Return After Crash'].iloc[-1],ESSaft['Cumulative Return After Crash'].iloc[-1],EXRaft['Cumulative Return After Crash'].iloc[-1],FRTaft['Cumulative Return After Crash'].iloc[-1],PEAKaft['Cumulative Return After Crash'].iloc[-1],HSTaft['Cumulative Return After Crash'].iloc[-1],IRMaft['Cumulative Return After Crash'].iloc[-1],KIMaft['Cumulative Return After Crash'].iloc[-1],MAAaft['Cumulative Return After Crash'].iloc[-1],PLDaft['Cumulative Return After Crash'].iloc[-1],PSAaft['Cumulative Return After Crash'].iloc[-1],Oaft['Cumulative Return After Crash'].iloc[-1],REGaft['Cumulative Return After Crash'].iloc[-1],SBACaft['Cumulative Return After Crash'].iloc[-1],SPGaft['Cumulative Return After Crash'].iloc[-1],SLGaft['Cumulative Return After Crash'].iloc[-1],UDRaft['Cumulative Return After Crash'].iloc[-1],VTRaft['Cumulative Return After Crash'].iloc[-1],VNOaft['Cumulative Return After Crash'].iloc[-1],WELLaft['Cumulative Return After Crash'].iloc[-1],WYaft['Cumulative Return After Crash'].iloc[-1]]}
redf2 = pd.DataFrame(cumret, columns = ['Cumulative Returns 12/4-6/5', 'Cumulative Returns 12/4-2/20', 'Cumulative Returns 2/20-3/23', 'Cumulative Returns 3/23-6/5'], index= ['S&P 500','ARE','AMT','AIV','AVB','BXP','CBRE','CCI','DLR','DRE','EQIX','EQR','ESS','EXR','FRT','PEAK','HST','IRM','KIM','MAA','PLD','PSA','O','REG','SBAC','SPG','SLG','UDR','VTR','VNO','WELL','WY'])
pd.DataFrame(redf2)
redf2.sort_values('Cumulative Returns 3/23-6/5', ascending=False)
#Table of Key Statistics of Real Estate Stocks
import pandas as pd
import statistics as stats
remeans = [AREmean,AMTmean,AIVmean,AVBmean,BXPmean,CBREmean,CCImean,DLRmean,DREmean,EQIXmean,EQRmean,ESSmean,EXRmean,FRTmean,PEAKmean,HSTmean,IRMmean,KIMmean,MAAmean,PLDmean,PSAmean,Omean,REGmean,SBACmean,SPGmean,SLGmean,UDRmean,VTRmean,VNOmean,WELLmean,WYmean]
reaveragemean = stats.mean(remeans)
revariances = [AREvar,AMTvar,AIVvar,AVBvar,BXPvar,CBREvar,CCIvar,DLRvar,DREvar,EQIXvar,EQRvar,ESSvar,EXRvar,FRTvar,PEAKvar,HSTvar,IRMvar,KIMvar,MAAvar,PLDvar,PSAvar,Ovar,REGvar,SBACvar,SPGvar,SLGvar,UDRvar,VTRvar,VNOvar,WELLvar,WYvar]
reaveragevar = stats.mean(revariances)
rekurtoses = [AREkurt,AMTkurt,AIVkurt,AVBkurt,BXPkurt,CBREkurt,CCIkurt,DLRkurt,DREkurt,EQIXkurt,EQRkurt,ESSkurt,EXRkurt,FRTkurt,PEAKkurt,HSTkurt,IRMkurt,KIMkurt,MAAkurt,PLDkurt,PSAkurt,Okurt,REGkurt,SBACkurt,SPGkurt,SLGkurt,UDRkurt,VTRkurt,VNOkurt,WELLkurt,WYkurt]
reaveragekurt = stats.mean(rekurtoses)
reskews = [AREskew,AMTskew,AIVskew,AVBskew,BXPskew,CBREskew,CCIskew,DLRskew,DREskew,EQIXskew,EQRskew,ESSskew,EXRskew,FRTskew,PEAKskew,HSTskew,IRMskew,KIMskew,MAAskew,PLDskew,PSAskew,Oskew,REGskew,SBACskew,SPGskew,SLGskew,UDRskew,VTRskew,VNOskew,WELLskew,WYskew]
reaverageskew = stats.mean(reskews)
Real_Estate = {'Mean': [[spmean],[reaveragemean],[AREmean], [AMTmean],[AIVmean],[AVBmean],[BXPmean],[CBREmean],[CCImean],[DLRmean],[DREmean],[EQIXmean],[EQRmean],[ESSmean],[EXRmean],[FRTmean],[PEAKmean],[HSTmean],[IRMmean],[KIMmean],[MAAmean],[PLDmean],[PSAmean],[Omean],[REGmean],[SBACmean],[SPGmean],[SLGmean],[UDRmean],[VTRmean],[VNOmean],[WELLmean],[WYmean]],
'Variance': [[spvar],[reaveragevar],[AREvar],[AMTvar],[AIVvar],[AVBvar],[BXPvar],[CBREvar],[CCIvar],[DLRvar],[DREvar],[EQIXvar],[EQRvar],[ESSvar],[EXRvar],[FRTvar],[PEAKvar],[HSTvar],[IRMvar],[KIMvar],[MAAvar],[PLDvar],[PSAvar],[Ovar],[REGvar],[SBACvar],[SPGvar],[SLGvar],[UDRvar],[VTRvar],[VNOvar],[WELLvar],[WYvar]],
'Kurtosis': [[spkurt],[reaveragekurt],[AREkurt],[AMTkurt],[AIVkurt],[AVBkurt],[BXPkurt],[CBREkurt],[CCIkurt],[DLRkurt],[DREkurt],[EQIXkurt],[EQRkurt],[ESSkurt],[EXRkurt],[FRTkurt],[PEAKkurt],[HSTkurt],[IRMkurt],[KIMkurt],[MAAkurt],[PLDkurt],[PSAkurt],[Okurt],[REGkurt],[SBACkurt],[SPGkurt],[SLGkurt],[UDRkurt],[VTRkurt],[VNOkurt],[WELLkurt],[WYkurt]],
'Skew': [[spskew],[reaverageskew],[AREskew],[AMTskew],[AIVskew],[AVBskew],[BXPskew],[CBREskew],[CCIskew],[DLRskew],[DREskew],[EQIXskew],[EQRskew],[ESSskew],[EXRskew],[FRTskew],[PEAKskew],[HSTskew],[IRMskew],[KIMskew],[MAAskew],[PLDskew],[PSAskew],[Oskew],[REGskew],[SBACskew],[SPGskew],[SLGskew],[UDRskew],[VTRskew],[VNOskew],[WELLskew],[WYskew]],
}
redf = pd.DataFrame(Real_Estate, columns = ['Mean', 'Variance', 'Kurtosis', 'Skew'], index= ['S&P 500','Average','ARE','AMT','AIV','AVB','BXP','CBRE','CCI','DLR','DRE','EQIX','EQR','ESS','EXR','FRT','PEAK','HST','IRM','KIM','MAA','PLD','PSA','O','REG','SBAC','SPG','SLG','UDR','VTR','VNO','WELL','WY']
)
pd.DataFrame(redf)
redf.sort_values("Mean", ascending=False)
#Average Stats across Sectors
Averages = {'Mean': [[spmean],[averagemean],[mataveragemean],[indaveragemean],[cdaveragemean],[cosaveragemean],[haveragemean],[faveragemean],[itaveragemean],[csaveragemean],[uaveragemean],[reaveragemean]],
'Variance': [[spvar],[averagevar],[mataveragevar],[indaveragevar],[cdaveragevar],[cosaveragevar],[haveragevar],[faveragevar],[itaveragevar],[csaveragevar],[uaveragevar],[reaveragevar]],
'Kurtosis': [[spkurt],[averagekurt],[mataveragekurt],[indaveragekurt],[cdaveragekurt],[cosaveragekurt],[haveragekurt],[faveragekurt],[itaveragekurt],[csaveragekurt],[uaveragekurt],[reaveragekurt]],
'Skew': [[spskew],[averageskew],[mataverageskew],[indaverageskew],[cdaverageskew],[cosaverageskew],[haverageskew],[faverageskew],[itaverageskew],[csaverageskew],[uaverageskew],[reaverageskew]]
}
avdf = pd.DataFrame(Averages, columns = ['Mean', 'Variance', 'Kurtosis', 'Skew'], index= ['S&P 500', 'Energy','Materials','Industrials','Consumer Discretionary','Consumer Staples','Healthcare','Financials','Information Technology','Communication Services','Utilities','Real Estate'])
pd.DataFrame(avdf)
#Cumulative Returns ALL STOCKS
cumret = {'Cumulative Returns 12/4-6/5': [sp['Cumulative Return'].iloc[-1],apache['Cumulative Return'].iloc[-1],baker['Cumulative Return'].iloc[-1],cabot['Cumulative Return'].iloc[-1],chevron['Cumulative Return'].iloc[-1],concho['Cumulative Return'].iloc[-1],conoco['Cumulative Return'].iloc[-1],devon['Cumulative Return'].iloc[-1],diamond['Cumulative Return'].iloc[-1],EOG['Cumulative Return'].iloc[-1],exxon['Cumulative Return'].iloc[-1],halliburton['Cumulative Return'].iloc[-1],hess['Cumulative Return'].iloc[-1],holly['Cumulative Return'].iloc[-1],kinder['Cumulative Return'].iloc[-1],marathonoil['Cumulative Return'].iloc[-1],marathonpet['Cumulative Return'].iloc[-1],national['Cumulative Return'].iloc[-1],noble['Cumulative Return'].iloc[-1],occidental['Cumulative Return'].iloc[-1],oneok['Cumulative Return'].iloc[-1],phillips66['Cumulative Return'].iloc[-1],pioneer['Cumulative Return'].iloc[-1],schlumberger['Cumulative Return'].iloc[-1],technip['Cumulative Return'].iloc[-1],valero['Cumulative Return'].iloc[-1],williams['Cumulative Return'].iloc[-1],APD['Cumulative Return'].iloc[-1],ALB['Cumulative Return'].iloc[-1],AMCR['Cumulative Return'].iloc[-1],AVY['Cumulative Return'].iloc[-1],BLL['Cumulative Return'].iloc[-1],CE['Cumulative Return'].iloc[-1],CF['Cumulative Return'].iloc[-1],CTVA['Cumulative Return'].iloc[-1],DOW['Cumulative Return'].iloc[-1],DD['Cumulative Return'].iloc[-1],EMN['Cumulative Return'].iloc[-1],ECL['Cumulative Return'].iloc[-1],FMC['Cumulative Return'].iloc[-1],FCX['Cumulative Return'].iloc[-1],IP['Cumulative Return'].iloc[-1],IFF['Cumulative Return'].iloc[-1],LIN['Cumulative Return'].iloc[-1],LYB['Cumulative Return'].iloc[-1],MLM['Cumulative Return'].iloc[-1],MOS['Cumulative Return'].iloc[-1],NEM['Cumulative Return'].iloc[-1],NUE['Cumulative Return'].iloc[-1],PKG['Cumulative Return'].iloc[-1],PPG['Cumulative Return'].iloc[-1],SEE['Cumulative Return'].iloc[-1],SHW['Cumulative Return'].iloc[-1],VMC['Cumulative Return'].iloc[-1],WRK['Cumulative Return'].iloc[-1],MMM['Cumulative Return'].iloc[-1],ALK['Cumulative Return'].iloc[-1],ALLE['Cumulative Return'].iloc[-1],AAL['Cumulative Return'].iloc[-1],AME['Cumulative Return'].iloc[-1],AOS['Cumulative Return'].iloc[-1],BA['Cumulative Return'].iloc[-1],CHRW['Cumulative Return'].iloc[-1],CAT['Cumulative Return'].iloc[-1],CTAS['Cumulative Return'].iloc[-1],CPRT['Cumulative Return'].iloc[-1],CSX['Cumulative Return'].iloc[-1],CMI['Cumulative Return'].iloc[-1],DE['Cumulative Return'].iloc[-1],DAL['Cumulative Return'].iloc[-1],DOV['Cumulative Return'].iloc[-1],ETN['Cumulative Return'].iloc[-1],EMR['Cumulative Return'].iloc[-1],EFX['Cumulative Return'].iloc[-1],EXPD['Cumulative Return'].iloc[-1],FAST['Cumulative Return'].iloc[-1],FDX['Cumulative Return'].iloc[-1],FLS['Cumulative Return'].iloc[-1],FTV['Cumulative Return'].iloc[-1],FBHS['Cumulative Return'].iloc[-1],GD['Cumulative Return'].iloc[-1],GE['Cumulative Return'].iloc[-1],GWW['Cumulative Return'].iloc[-1],HON['Cumulative Return'].iloc[-1],HWM['Cumulative Return'].iloc[-1],HII['Cumulative Return'].iloc[-1],IEX['Cumulative Return'].iloc[-1],INFO['Cumulative Return'].iloc[-1],ITW['Cumulative Return'].iloc[-1],IR['Cumulative Return'].iloc[-1],J['Cumulative Return'].iloc[-1],JBHT['Cumulative Return'].iloc[-1],JCI['Cumulative Return'].iloc[-1],KSU['Cumulative Return'].iloc[-1],LHX['Cumulative Return'].iloc[-1],LMT['Cumulative Return'].iloc[-1],MAS['Cumulative Return'].iloc[-1],NLSN['Cumulative Return'].iloc[-1],NSC['Cumulative Return'].iloc[-1],NOC['Cumulative Return'].iloc[-1],ODFL['Cumulative Return'].iloc[-1],PCAR['Cumulative Return'].iloc[-1],PH['Cumulative Return'].iloc[-1],PNR['Cumulative Return'].iloc[-1],PWR['Cumulative Return'].iloc[-1],RTX['Cumulative Return'].iloc[-1],RSG['Cumulative Return'].iloc[-1],RHI['Cumulative Return'].iloc[-1],ROK['Cumulative Return'].iloc[-1],ROL['Cumulative Return'].iloc[-1],ROP['Cumulative Return'].iloc[-1],SNA['Cumulative Return'].iloc[-1],LUV['Cumulative Return'].iloc[-1],SWK['Cumulative Return'].iloc[-1],TXT['Cumulative Return'].iloc[-1],TT['Cumulative Return'].iloc[-1],TDG['Cumulative Return'].iloc[-1],UNP['Cumulative Return'].iloc[-1],UAL['Cumulative Return'].iloc[-1],UPS['Cumulative Return'].iloc[-1],URI['Cumulative Return'].iloc[-1],VRSK['Cumulative Return'].iloc[-1],WAB['Cumulative Return'].iloc[-1],WM['Cumulative Return'].iloc[-1],XYL['Cumulative Return'].iloc[-1],AAP['Cumulative Return'].iloc[-1],AMZN['Cumulative Return'].iloc[-1],APTV['Cumulative Return'].iloc[-1],AZO['Cumulative Return'].iloc[-1],BBY['Cumulative Return'].iloc[-1],BKNG['Cumulative Return'].iloc[-1],BWA['Cumulative Return'].iloc[-1],KMX['Cumulative Return'].iloc[-1],CCL['Cumulative Return'].iloc[-1],CMG['Cumulative Return'].iloc[-1],DHI['Cumulative Return'].iloc[-1],DRI['Cumulative Return'].iloc[-1],DG['Cumulative Return'].iloc[-1],DLTR['Cumulative Return'].iloc[-1],DPZ['Cumulative Return'].iloc[-1],EBAY['Cumulative Return'].iloc[-1],EXPE['Cumulative Return'].iloc[-1],F['Cumulative Return'].iloc[-1],GPS['Cumulative Return'].iloc[-1],GRMN['Cumulative Return'].iloc[-1],GM['Cumulative Return'].iloc[-1],GPC['Cumulative Return'].iloc[-1],HRB['Cumulative Return'].iloc[-1],HBI['Cumulative Return'].iloc[-1],HOG['Cumulative Return'].iloc[-1],HAS['Cumulative Return'].iloc[-1],HLT['Cumulative Return'].iloc[-1],HD['Cumulative Return'].iloc[-1],KSS['Cumulative Return'].iloc[-1],LB['Cumulative Return'].iloc[-1],LVS['Cumulative Return'].iloc[-1],LEG['Cumulative Return'].iloc[-1],LEN['Cumulative Return'].iloc[-1],LKQ['Cumulative Return'].iloc[-1],LOW['Cumulative Return'].iloc[-1],MAR['Cumulative Return'].iloc[-1],MCD['Cumulative Return'].iloc[-1],MGM['Cumulative Return'].iloc[-1],MHK['Cumulative Return'].iloc[-1],NWL['Cumulative Return'].iloc[-1],NKE['Cumulative Return'].iloc[-1],JWN['Cumulative Return'].iloc[-1],NCLH['Cumulative Return'].iloc[-1],NVR['Cumulative Return'].iloc[-1],ORLY['Cumulative Return'].iloc[-1],PHM['Cumulative Return'].iloc[-1],PVH['Cumulative Return'].iloc[-1],RL['Cumulative Return'].iloc[-1],ROST['Cumulative Return'].iloc[-1],RCL['Cumulative Return'].iloc[-1],SBUX['Cumulative Return'].iloc[-1],TPR['Cumulative Return'].iloc[-1],TGT['Cumulative Return'].iloc[-1],TIF['Cumulative Return'].iloc[-1],TJX['Cumulative Return'].iloc[-1],TSCO['Cumulative Return'].iloc[-1],ULTA['Cumulative Return'].iloc[-1],UAA['Cumulative Return'].iloc[-1],UA['Cumulative Return'].iloc[-1],VFC['Cumulative Return'].iloc[-1],WHR['Cumulative Return'].iloc[-1],WYNN['Cumulative Return'].iloc[-1],YUM['Cumulative Return'].iloc[-1],MO['Cumulative Return'].iloc[-1],ADM['Cumulative Return'].iloc[-1],BFB['Cumulative Return'].iloc[-1],CPB['Cumulative Return'].iloc[-1],CHD['Cumulative Return'].iloc[-1],CLX['Cumulative Return'].iloc[-1],KO['Cumulative Return'].iloc[-1],CL['Cumulative Return'].iloc[-1],CAG['Cumulative Return'].iloc[-1],STZ['Cumulative Return'].iloc[-1],COST['Cumulative Return'].iloc[-1],COTY['Cumulative Return'].iloc[-1],EL['Cumulative Return'].iloc[-1],GIS['Cumulative Return'].iloc[-1],HSY['Cumulative Return'].iloc[-1],HRL['Cumulative Return'].iloc[-1],SJM['Cumulative Return'].iloc[-1],K['Cumulative Return'].iloc[-1],KMB['Cumulative Return'].iloc[-1],KHC['Cumulative Return'].iloc[-1],KR['Cumulative Return'].iloc[-1],LW['Cumulative Return'].iloc[-1],MKC['Cumulative Return'].iloc[-1],TAP['Cumulative Return'].iloc[-1],MDLZ['Cumulative Return'].iloc[-1],MNST['Cumulative Return'].iloc[-1],PEP['Cumulative Return'].iloc[-1],PM['Cumulative Return'].iloc[-1],PG['Cumulative Return'].iloc[-1],SYY['Cumulative Return'].iloc[-1],TSN['Cumulative Return'].iloc[-1],WMT['Cumulative Return'].iloc[-1],WBA['Cumulative Return'].iloc[-1],ABT['Cumulative Return'].iloc[-1],ABBV['Cumulative Return'].iloc[-1],ABMD['Cumulative Return'].iloc[-1],A['Cumulative Return'].iloc[-1],ALXN['Cumulative Return'].iloc[-1],ALGN['Cumulative Return'].iloc[-1],ABC['Cumulative Return'].iloc[-1],AMGN['Cumulative Return'].iloc[-1],ANTM['Cumulative Return'].iloc[-1],BAX['Cumulative Return'].iloc[-1],BDX['Cumulative Return'].iloc[-1],BIIB['Cumulative Return'].iloc[-1],BSX['Cumulative Return'].iloc[-1],BMY['Cumulative Return'].iloc[-1],CAH['Cumulative Return'].iloc[-1],CNC['Cumulative Return'].iloc[-1],CERN['Cumulative Return'].iloc[-1],CI['Cumulative Return'].iloc[-1],COO['Cumulative Return'].iloc[-1],CVS['Cumulative Return'].iloc[-1],DHR['Cumulative Return'].iloc[-1],DVA['Cumulative Return'].iloc[-1],XRAY['Cumulative Return'].iloc[-1],DXCM['Cumulative Return'].iloc[-1],EW['Cumulative Return'].iloc[-1],GILD['Cumulative Return'].iloc[-1],HCA['Cumulative Return'].iloc[-1],HSIC['Cumulative Return'].iloc[-1],HOLX['Cumulative Return'].iloc[-1],HUM['Cumulative Return'].iloc[-1],IDXX['Cumulative Return'].iloc[-1],ILMN['Cumulative Return'].iloc[-1],INCY['Cumulative Return'].iloc[-1],ISRG['Cumulative Return'].iloc[-1],IQV['Cumulative Return'].iloc[-1],JNJ['Cumulative Return'].iloc[-1],LH['Cumulative Return'].iloc[-1],LLY['Cumulative Return'].iloc[-1],MCK['Cumulative Return'].iloc[-1],MDT['Cumulative Return'].iloc[-1],MRK['Cumulative Return'].iloc[-1],MTD['Cumulative Return'].iloc[-1],MYL['Cumulative Return'].iloc[-1],PKI['Cumulative Return'].iloc[-1],PRGO['Cumulative Return'].iloc[-1],PFE['Cumulative Return'].iloc[-1],DGX['Cumulative Return'].iloc[-1],REGN['Cumulative Return'].iloc[-1],RMD['Cumulative Return'].iloc[-1],STE['Cumulative Return'].iloc[-1],SYK['Cumulative Return'].iloc[-1],TFX['Cumulative Return'].iloc[-1],TMO['Cumulative Return'].iloc[-1],UNH['Cumulative Return'].iloc[-1],UHS['Cumulative Return'].iloc[-1],VAR['Cumulative Return'].iloc[-1],VRTX['Cumulative Return'].iloc[-1],WAT['Cumulative Return'].iloc[-1],WST['Cumulative Return'].iloc[-1],ZBH['Cumulative Return'].iloc[-1],ZTS['Cumulative Return'].iloc[-1],AFL['Cumulative Return'].iloc[-1],ALL['Cumulative Return'].iloc[-1],AXP['Cumulative Return'].iloc[-1],AIG['Cumulative Return'].iloc[-1],AMP['Cumulative Return'].iloc[-1],AON['Cumulative Return'].iloc[-1],AJG['Cumulative Return'].iloc[-1],AIZ['Cumulative Return'].iloc[-1],BAC['Cumulative Return'].iloc[-1],BK['Cumulative Return'].iloc[-1],BRKB['Cumulative Return'].iloc[-1],BLK['Cumulative Return'].iloc[-1],COF['Cumulative Return'].iloc[-1],CBOE['Cumulative Return'].iloc[-1],SCHW['Cumulative Return'].iloc[-1],CB['Cumulative Return'].iloc[-1],CINF['Cumulative Return'].iloc[-1],C['Cumulative Return'].iloc[-1],CFG['Cumulative Return'].iloc[-1],CME['Cumulative Return'].iloc[-1],CMA['Cumulative Return'].iloc[-1],DFS['Cumulative Return'].iloc[-1],ETFC['Cumulative Return'].iloc[-1],RE['Cumulative Return'].iloc[-1],FITB['Cumulative Return'].iloc[-1],FRC['Cumulative Return'].iloc[-1],BEN['Cumulative Return'].iloc[-1],GL['Cumulative Return'].iloc[-1],GS['Cumulative Return'].iloc[-1],HIG['Cumulative Return'].iloc[-1],HBAN['Cumulative Return'].iloc[-1],ICE['Cumulative Return'].iloc[-1],IVZ['Cumulative Return'].iloc[-1],JPM['Cumulative Return'].iloc[-1],KEY['Cumulative Return'].iloc[-1],LNC['Cumulative Return'].iloc[-1],L['Cumulative Return'].iloc[-1],MTB['Cumulative Return'].iloc[-1],MKTX['Cumulative Return'].iloc[-1],MMC['Cumulative Return'].iloc[-1],MET['Cumulative Return'].iloc[-1],MCO['Cumulative Return'].iloc[-1],MS['Cumulative Return'].iloc[-1],MSCI['Cumulative Return'].iloc[-1],NDAQ['Cumulative Return'].iloc[-1],NTRS['Cumulative Return'].iloc[-1],PBCT['Cumulative Return'].iloc[-1],PNC['Cumulative Return'].iloc[-1],PFG['Cumulative Return'].iloc[-1],PGR['Cumulative Return'].iloc[-1],PRU['Cumulative Return'].iloc[-1],RJF['Cumulative Return'].iloc[-1],RF['Cumulative Return'].iloc[-1],SPGI['Cumulative Return'].iloc[-1],STT['Cumulative Return'].iloc[-1],SIVB['Cumulative Return'].iloc[-1],SYF['Cumulative Return'].iloc[-1],TROW['Cumulative Return'].iloc[-1],TRV['Cumulative Return'].iloc[-1],TFC['Cumulative Return'].iloc[-1],USB['Cumulative Return'].iloc[-1],UNM['Cumulative Return'].iloc[-1],WRB['Cumulative Return'].iloc[-1],WFC['Cumulative Return'].iloc[-1],WLTW['Cumulative Return'].iloc[-1],ZION['Cumulative Return'].iloc[-1],ACN['Cumulative Return'].iloc[-1],ADBE['Cumulative Return'].iloc[-1],AMD['Cumulative Return'].iloc[-1],AKAM['Cumulative Return'].iloc[-1],ADS['Cumulative Return'].iloc[-1],APH['Cumulative Return'].iloc[-1],ADI['Cumulative Return'].iloc[-1],ANSS['Cumulative Return'].iloc[-1],AAPL['Cumulative Return'].iloc[-1],AMAT['Cumulative Return'].iloc[-1],ANET['Cumulative Return'].iloc[-1],ADSK['Cumulative Return'].iloc[-1],ADP['Cumulative Return'].iloc[-1],AVGO['Cumulative Return'].iloc[-1],BR['Cumulative Return'].iloc[-1],CDNS['Cumulative Return'].iloc[-1],CDW['Cumulative Return'].iloc[-1],CSCO['Cumulative Return'].iloc[-1],CTXS['Cumulative Return'].iloc[-1],CTSH['Cumulative Return'].iloc[-1],GLW['Cumulative Return'].iloc[-1],DXC['Cumulative Return'].iloc[-1],FFIV['Cumulative Return'].iloc[-1],FIS['Cumulative Return'].iloc[-1],FISV['Cumulative Return'].iloc[-1],FLT['Cumulative Return'].iloc[-1],FLIR['Cumulative Return'].iloc[-1],FTNT['Cumulative Return'].iloc[-1],IT['Cumulative Return'].iloc[-1],GPN['Cumulative Return'].iloc[-1],HPE['Cumulative Return'].iloc[-1],HPQ['Cumulative Return'].iloc[-1],INTC['Cumulative Return'].iloc[-1],IBM['Cumulative Return'].iloc[-1],INTU['Cumulative Return'].iloc[-1],IPGP['Cumulative Return'].iloc[-1],JKHY['Cumulative Return'].iloc[-1],JNPR['Cumulative Return'].iloc[-1],KEYS['Cumulative Return'].iloc[-1],KLAC['Cumulative Return'].iloc[-1],LRCX['Cumulative Return'].iloc[-1],LDOS['Cumulative Return'].iloc[-1],MA['Cumulative Return'].iloc[-1],MXIM['Cumulative Return'].iloc[-1],MCHP['Cumulative Return'].iloc[-1],MU['Cumulative Return'].iloc[-1],MSFT['Cumulative Return'].iloc[-1],MSI['Cumulative Return'].iloc[-1],NTAP['Cumulative Return'].iloc[-1],NLOK['Cumulative Return'].iloc[-1],NVDA['Cumulative Return'].iloc[-1],ORCL['Cumulative Return'].iloc[-1],PAYX['Cumulative Return'].iloc[-1],PAYC['Cumulative Return'].iloc[-1],PYPL['Cumulative Return'].iloc[-1],QRVO['Cumulative Return'].iloc[-1],QCOM['Cumulative Return'].iloc[-1],CRM['Cumulative Return'].iloc[-1],STX['Cumulative Return'].iloc[-1],NOW['Cumulative Return'].iloc[-1],SWKS['Cumulative Return'].iloc[-1],SNPS['Cumulative Return'].iloc[-1],TEL['Cumulative Return'].iloc[-1],TXN['Cumulative Return'].iloc[-1],VRSN['Cumulative Return'].iloc[-1],V['Cumulative Return'].iloc[-1],WDC['Cumulative Return'].iloc[-1],WU['Cumulative Return'].iloc[-1],XRX['Cumulative Return'].iloc[-1],XLNX['Cumulative Return'].iloc[-1],ZBRA['Cumulative Return'].iloc[-1],ATVI['Cumulative Return'].iloc[-1],GOOGL['Cumulative Return'].iloc[-1],GOOG['Cumulative Return'].iloc[-1],T['Cumulative Return'].iloc[-1],CTL['Cumulative Return'].iloc[-1],CHTR['Cumulative Return'].iloc[-1],CMCSA['Cumulative Return'].iloc[-1],DISCA['Cumulative Return'].iloc[-1],DISCK['Cumulative Return'].iloc[-1],DISH['Cumulative Return'].iloc[-1],EA['Cumulative Return'].iloc[-1],FB['Cumulative Return'].iloc[-1],FOXA['Cumulative Return'].iloc[-1],FOX['Cumulative Return'].iloc[-1],IPG['Cumulative Return'].iloc[-1],LYV['Cumulative Return'].iloc[-1],NFLX['Cumulative Return'].iloc[-1],NWSA['Cumulative Return'].iloc[-1],NWS['Cumulative Return'].iloc[-1],OMC['Cumulative Return'].iloc[-1],TMUS['Cumulative Return'].iloc[-1],TTWO['Cumulative Return'].iloc[-1],TWTR['Cumulative Return'].iloc[-1],VZ['Cumulative Return'].iloc[-1],VIAC['Cumulative Return'].iloc[-1],DIS['Cumulative Return'].iloc[-1],AES['Cumulative Return'].iloc[-1],LNT['Cumulative Return'].iloc[-1],AEE['Cumulative Return'].iloc[-1],AEP['Cumulative Return'].iloc[-1],AWK['Cumulative Return'].iloc[-1],ATO['Cumulative Return'].iloc[-1],CNP['Cumulative Return'].iloc[-1],CMS['Cumulative Return'].iloc[-1],ED['Cumulative Return'].iloc[-1],D['Cumulative Return'].iloc[-1],DTE['Cumulative Return'].iloc[-1],DUK['Cumulative Return'].iloc[-1],EIX['Cumulative Return'].iloc[-1],ETR['Cumulative Return'].iloc[-1],EVRG['Cumulative Return'].iloc[-1],ES['Cumulative Return'].iloc[-1],EXC['Cumulative Return'].iloc[-1],FE['Cumulative Return'].iloc[-1],NEE['Cumulative Return'].iloc[-1],NI['Cumulative Return'].iloc[-1],NRG['Cumulative Return'].iloc[-1],PNW['Cumulative Return'].iloc[-1],PPL['Cumulative Return'].iloc[-1],PEG['Cumulative Return'].iloc[-1],SRE['Cumulative Return'].iloc[-1],SO['Cumulative Return'].iloc[-1],WEC['Cumulative Return'].iloc[-1],XEL['Cumulative Return'].iloc[-1],ARE['Cumulative Return'].iloc[-1],AMT['Cumulative Return'].iloc[-1],AIV['Cumulative Return'].iloc[-1],AVB['Cumulative Return'].iloc[-1],BXP['Cumulative Return'].iloc[-1],CBRE['Cumulative Return'].iloc[-1],CCI['Cumulative Return'].iloc[-1],DLR['Cumulative Return'].iloc[-1],DRE['Cumulative Return'].iloc[-1],EQIX['Cumulative Return'].iloc[-1],EQR['Cumulative Return'].iloc[-1],ESS['Cumulative Return'].iloc[-1],EXR['Cumulative Return'].iloc[-1],FRT['Cumulative Return'].iloc[-1],PEAK['Cumulative Return'].iloc[-1],HST['Cumulative Return'].iloc[-1],IRM['Cumulative Return'].iloc[-1],KIM['Cumulative Return'].iloc[-1],MAA['Cumulative Return'].iloc[-1],PLD['Cumulative Return'].iloc[-1],PSA['Cumulative Return'].iloc[-1],O['Cumulative Return'].iloc[-1],REG['Cumulative Return'].iloc[-1],SBAC['Cumulative Return'].iloc[-1],SPG['Cumulative Return'].iloc[-1],SLG['Cumulative Return'].iloc[-1],UDR['Cumulative Return'].iloc[-1],VTR['Cumulative Return'].iloc[-1],VNO['Cumulative Return'].iloc[-1],WELL['Cumulative Return'].iloc[-1],WY['Cumulative Return'].iloc[-1]],
'Cumulative Returns 12/4-2/20': [spbef['Cumulative Return Before Crash'].iloc[-1],apachebef['Cumulative Return Before Crash'].iloc[-1],bakerbef['Cumulative Return Before Crash'].iloc[-1],cabotbef['Cumulative Return Before Crash'].iloc[-1],chevronbef['Cumulative Return Before Crash'].iloc[-1],conchobef['Cumulative Return Before Crash'].iloc[-1],conocobef['Cumulative Return Before Crash'].iloc[-1],devonbef['Cumulative Return Before Crash'].iloc[-1],diamondbef['Cumulative Return Before Crash'].iloc[-1],EOGbef['Cumulative Return Before Crash'].iloc[-1],exxonbef['Cumulative Return Before Crash'].iloc[-1],halliburtonbef['Cumulative Return Before Crash'].iloc[-1],hessbef['Cumulative Return Before Crash'].iloc[-1],hollybef['Cumulative Return Before Crash'].iloc[-1],kinderbef['Cumulative Return Before Crash'].iloc[-1],marathonoilbef['Cumulative Return Before Crash'].iloc[-1],marathonpetbef['Cumulative Return Before Crash'].iloc[-1],nationalbef['Cumulative Return Before Crash'].iloc[-1],noblebef['Cumulative Return Before Crash'].iloc[-1],occidentalbef['Cumulative Return Before Crash'].iloc[-1],oneokbef['Cumulative Return Before Crash'].iloc[-1],phillips66bef['Cumulative Return Before Crash'].iloc[-1],pioneerbef['Cumulative Return Before Crash'].iloc[-1],schlumbergerbef['Cumulative Return Before Crash'].iloc[-1],technipbef['Cumulative Return Before Crash'].iloc[-1],valerobef['Cumulative Return Before Crash'].iloc[-1],williamsbef['Cumulative Return Before Crash'].iloc[-1],APDbef['Cumulative Return Before Crash'].iloc[-1],ALBbef['Cumulative Return Before Crash'].iloc[-1],AMCRbef['Cumulative Return Before Crash'].iloc[-1],AVYbef['Cumulative Return Before Crash'].iloc[-1],BLLbef['Cumulative Return Before Crash'].iloc[-1],CEbef['Cumulative Return Before Crash'].iloc[-1],CFbef['Cumulative Return Before Crash'].iloc[-1],CTVAbef['Cumulative Return Before Crash'].iloc[-1],DOWbef['Cumulative Return Before Crash'].iloc[-1],DDbef['Cumulative Return Before Crash'].iloc[-1],EMNbef['Cumulative Return Before Crash'].iloc[-1],ECLbef['Cumulative Return Before Crash'].iloc[-1],FMCbef['Cumulative Return Before Crash'].iloc[-1],FCXbef['Cumulative Return Before Crash'].iloc[-1],IPbef['Cumulative Return Before Crash'].iloc[-1],IFFbef['Cumulative Return Before Crash'].iloc[-1],LINbef['Cumulative Return Before Crash'].iloc[-1],LYBbef['Cumulative Return Before Crash'].iloc[-1],MLMbef['Cumulative Return Before Crash'].iloc[-1],MOSbef['Cumulative Return Before Crash'].iloc[-1],NEMbef['Cumulative Return Before Crash'].iloc[-1],NUEbef['Cumulative Return Before Crash'].iloc[-1],PKGbef['Cumulative Return Before Crash'].iloc[-1],PPGbef['Cumulative Return Before Crash'].iloc[-1],SEEbef['Cumulative Return Before Crash'].iloc[-1],SHWbef['Cumulative Return Before Crash'].iloc[-1],VMCbef['Cumulative Return Before Crash'].iloc[-1],WRKbef['Cumulative Return Before Crash'].iloc[-1],MMMbef['Cumulative Return Before Crash'].iloc[-1],ALKbef['Cumulative Return Before Crash'].iloc[-1],ALLEbef['Cumulative Return Before Crash'].iloc[-1],AALbef['Cumulative Return Before Crash'].iloc[-1],AMEbef['Cumulative Return Before Crash'].iloc[-1],AOSbef['Cumulative Return Before Crash'].iloc[-1],BAbef['Cumulative Return Before Crash'].iloc[-1],CHRWbef['Cumulative Return Before Crash'].iloc[-1],CATbef['Cumulative Return Before Crash'].iloc[-1],CTASbef['Cumulative Return Before Crash'].iloc[-1],CPRTbef['Cumulative Return Before Crash'].iloc[-1],CSXbef['Cumulative Return Before Crash'].iloc[-1],CMIbef['Cumulative Return Before Crash'].iloc[-1],DEbef['Cumulative Return Before Crash'].iloc[-1],DALbef['Cumulative Return Before Crash'].iloc[-1],DOVbef['Cumulative Return Before Crash'].iloc[-1],ETNbef['Cumulative Return Before Crash'].iloc[-1],EMRbef['Cumulative Return Before Crash'].iloc[-1],EFXbef['Cumulative Return Before Crash'].iloc[-1],EXPDbef['Cumulative Return Before Crash'].iloc[-1],FASTbef['Cumulative Return Before Crash'].iloc[-1],FDXbef['Cumulative Return Before Crash'].iloc[-1],FLSbef['Cumulative Return Before Crash'].iloc[-1],FTVbef['Cumulative Return Before Crash'].iloc[-1],FBHSbef['Cumulative Return Before Crash'].iloc[-1],GDbef['Cumulative Return Before Crash'].iloc[-1],GEbef['Cumulative Return Before Crash'].iloc[-1],GWWbef['Cumulative Return Before Crash'].iloc[-1],HONbef['Cumulative Return Before Crash'].iloc[-1],HWMbef['Cumulative Return Before Crash'].iloc[-1],HIIbef['Cumulative Return Before Crash'].iloc[-1],IEXbef['Cumulative Return Before Crash'].iloc[-1],INFObef['Cumulative Return Before Crash'].iloc[-1],ITWbef['Cumulative Return Before Crash'].iloc[-1],IRbef['Cumulative Return Before Crash'].iloc[-1],Jbef['Cumulative Return Before Crash'].iloc[-1],JBHTbef['Cumulative Return Before Crash'].iloc[-1],JCIbef['Cumulative Return Before Crash'].iloc[-1],KSUbef['Cumulative Return Before Crash'].iloc[-1],LHXbef['Cumulative Return Before Crash'].iloc[-1],LMTbef['Cumulative Return Before Crash'].iloc[-1],MASbef['Cumulative Return Before Crash'].iloc[-1],NLSNbef['Cumulative Return Before Crash'].iloc[-1],NSCbef['Cumulative Return Before Crash'].iloc[-1],NOCbef['Cumulative Return Before Crash'].iloc[-1],ODFLbef['Cumulative Return Before Crash'].iloc[-1],PCARbef['Cumulative Return Before Crash'].iloc[-1],PHbef['Cumulative Return Before Crash'].iloc[-1],PNRbef['Cumulative Return Before Crash'].iloc[-1],PWRbef['Cumulative Return Before Crash'].iloc[-1],RTXbef['Cumulative Return Before Crash'].iloc[-1],RSGbef['Cumulative Return Before Crash'].iloc[-1],RHIbef['Cumulative Return Before Crash'].iloc[-1],ROKbef['Cumulative Return Before Crash'].iloc[-1],ROLbef['Cumulative Return Before Crash'].iloc[-1],ROPbef['Cumulative Return Before Crash'].iloc[-1],SNAbef['Cumulative Return Before Crash'].iloc[-1],LUVbef['Cumulative Return Before Crash'].iloc[-1],SWKbef['Cumulative Return Before Crash'].iloc[-1],TXTbef['Cumulative Return Before Crash'].iloc[-1],TTbef['Cumulative Return Before Crash'].iloc[-1],TDGbef['Cumulative Return Before Crash'].iloc[-1],UNPbef['Cumulative Return Before Crash'].iloc[-1],UALbef['Cumulative Return Before Crash'].iloc[-1],UPSbef['Cumulative Return Before Crash'].iloc[-1],URIbef['Cumulative Return Before Crash'].iloc[-1],VRSKbef['Cumulative Return Before Crash'].iloc[-1],WABbef['Cumulative Return Before Crash'].iloc[-1],WMbef['Cumulative Return Before Crash'].iloc[-1],XYLbef['Cumulative Return Before Crash'].iloc[-1],AAPbef['Cumulative Return Before Crash'].iloc[-1],AMZNbef['Cumulative Return Before Crash'].iloc[-1],APTVbef['Cumulative Return Before Crash'].iloc[-1],AZObef['Cumulative Return Before Crash'].iloc[-1],BBYbef['Cumulative Return Before Crash'].iloc[-1],BKNGbef['Cumulative Return Before Crash'].iloc[-1],BWAbef['Cumulative Return Before Crash'].iloc[-1],KMXbef['Cumulative Return Before Crash'].iloc[-1],CCLbef['Cumulative Return Before Crash'].iloc[-1],CMGbef['Cumulative Return Before Crash'].iloc[-1],DHIbef['Cumulative Return Before Crash'].iloc[-1],DRIbef['Cumulative Return Before Crash'].iloc[-1],DGbef['Cumulative Return Before Crash'].iloc[-1],DLTRbef['Cumulative Return Before Crash'].iloc[-1],DPZbef['Cumulative Return Before Crash'].iloc[-1],EBAYbef['Cumulative Return Before Crash'].iloc[-1],EXPEbef['Cumulative Return Before Crash'].iloc[-1],Fbef['Cumulative Return Before Crash'].iloc[-1],GPSbef['Cumulative Return Before Crash'].iloc[-1],GRMNbef['Cumulative Return Before Crash'].iloc[-1],GMbef['Cumulative Return Before Crash'].iloc[-1],GPCbef['Cumulative Return Before Crash'].iloc[-1],HRBbef['Cumulative Return Before Crash'].iloc[-1],HBIbef['Cumulative Return Before Crash'].iloc[-1],HOGbef['Cumulative Return Before Crash'].iloc[-1],HASbef['Cumulative Return Before Crash'].iloc[-1],HLTbef['Cumulative Return Before Crash'].iloc[-1],HDbef['Cumulative Return Before Crash'].iloc[-1],KSSbef['Cumulative Return Before Crash'].iloc[-1],LBbef['Cumulative Return Before Crash'].iloc[-1],LVSbef['Cumulative Return Before Crash'].iloc[-1],LEGbef['Cumulative Return Before Crash'].iloc[-1],LENbef['Cumulative Return Before Crash'].iloc[-1],LKQbef['Cumulative Return Before Crash'].iloc[-1],LOWbef['Cumulative Return Before Crash'].iloc[-1],MARbef['Cumulative Return Before Crash'].iloc[-1],MCDbef['Cumulative Return Before Crash'].iloc[-1],MGMbef['Cumulative Return Before Crash'].iloc[-1],MHKbef['Cumulative Return Before Crash'].iloc[-1],NWLbef['Cumulative Return Before Crash'].iloc[-1],NKEbef['Cumulative Return Before Crash'].iloc[-1],JWNbef['Cumulative Return Before Crash'].iloc[-1],NCLHbef['Cumulative Return Before Crash'].iloc[-1],NVRbef['Cumulative Return Before Crash'].iloc[-1],ORLYbef['Cumulative Return Before Crash'].iloc[-1],PHMbef['Cumulative Return Before Crash'].iloc[-1],PVHbef['Cumulative Return Before Crash'].iloc[-1],RLbef['Cumulative Return Before Crash'].iloc[-1],ROSTbef['Cumulative Return Before Crash'].iloc[-1],RCLbef['Cumulative Return Before Crash'].iloc[-1],SBUXbef['Cumulative Return Before Crash'].iloc[-1],TPRbef['Cumulative Return Before Crash'].iloc[-1],TGTbef['Cumulative Return Before Crash'].iloc[-1],TIFbef['Cumulative Return Before Crash'].iloc[-1],TJXbef['Cumulative Return Before Crash'].iloc[-1],TSCObef['Cumulative Return Before Crash'].iloc[-1],ULTAbef['Cumulative Return Before Crash'].iloc[-1],UAAbef['Cumulative Return Before Crash'].iloc[-1],UAbef['Cumulative Return Before Crash'].iloc[-1],VFCbef['Cumulative Return Before Crash'].iloc[-1],WHRbef['Cumulative Return Before Crash'].iloc[-1],WYNNbef['Cumulative Return Before Crash'].iloc[-1],YUMbef['Cumulative Return Before Crash'].iloc[-1],MObef['Cumulative Return Before Crash'].iloc[-1],ADMbef['Cumulative Return Before Crash'].iloc[-1],BFBbef['Cumulative Return Before Crash'].iloc[-1],CPBbef['Cumulative Return Before Crash'].iloc[-1],CHDbef['Cumulative Return Before Crash'].iloc[-1],CLXbef['Cumulative Return Before Crash'].iloc[-1],KObef['Cumulative Return Before Crash'].iloc[-1],CLbef['Cumulative Return Before Crash'].iloc[-1],CAGbef['Cumulative Return Before Crash'].iloc[-1],STZbef['Cumulative Return Before Crash'].iloc[-1],COSTbef['Cumulative Return Before Crash'].iloc[-1],COTYbef['Cumulative Return Before Crash'].iloc[-1],ELbef['Cumulative Return Before Crash'].iloc[-1],GISbef['Cumulative Return Before Crash'].iloc[-1],HSYbef['Cumulative Return Before Crash'].iloc[-1],HRLbef['Cumulative Return Before Crash'].iloc[-1],SJMbef['Cumulative Return Before Crash'].iloc[-1],Kbef['Cumulative Return Before Crash'].iloc[-1],KMBbef['Cumulative Return Before Crash'].iloc[-1],KHCbef['Cumulative Return Before Crash'].iloc[-1],KRbef['Cumulative Return Before Crash'].iloc[-1],LWbef['Cumulative Return Before Crash'].iloc[-1],MKCbef['Cumulative Return Before Crash'].iloc[-1],TAPbef['Cumulative Return Before Crash'].iloc[-1],MDLZbef['Cumulative Return Before Crash'].iloc[-1],MNSTbef['Cumulative Return Before Crash'].iloc[-1],PEPbef['Cumulative Return Before Crash'].iloc[-1],PMbef['Cumulative Return Before Crash'].iloc[-1],PGbef['Cumulative Return Before Crash'].iloc[-1],SYYbef['Cumulative Return Before Crash'].iloc[-1],TSNbef['Cumulative Return Before Crash'].iloc[-1],WMTbef['Cumulative Return Before Crash'].iloc[-1],WBAbef['Cumulative Return Before Crash'].iloc[-1],ABTbef['Cumulative Return Before Crash'].iloc[-1],ABBVbef['Cumulative Return Before Crash'].iloc[-1],ABMDbef['Cumulative Return Before Crash'].iloc[-1],Abef['Cumulative Return Before Crash'].iloc[-1],ALXNbef['Cumulative Return Before Crash'].iloc[-1],ALGNbef['Cumulative Return Before Crash'].iloc[-1],ABCbef['Cumulative Return Before Crash'].iloc[-1],AMGNbef['Cumulative Return Before Crash'].iloc[-1],ANTMbef['Cumulative Return Before Crash'].iloc[-1],BAXbef['Cumulative Return Before Crash'].iloc[-1],BDXbef['Cumulative Return Before Crash'].iloc[-1],BIIBbef['Cumulative Return Before Crash'].iloc[-1],BSXbef['Cumulative Return Before Crash'].iloc[-1],BMYbef['Cumulative Return Before Crash'].iloc[-1],CAHbef['Cumulative Return Before Crash'].iloc[-1],CNCbef['Cumulative Return Before Crash'].iloc[-1],CERNbef['Cumulative Return Before Crash'].iloc[-1],CIbef['Cumulative Return Before Crash'].iloc[-1],COObef['Cumulative Return Before Crash'].iloc[-1],CVSbef['Cumulative Return Before Crash'].iloc[-1],DHRbef['Cumulative Return Before Crash'].iloc[-1],DVAbef['Cumulative Return Before Crash'].iloc[-1],XRAYbef['Cumulative Return Before Crash'].iloc[-1],DXCMbef['Cumulative Return Before Crash'].iloc[-1],EWbef['Cumulative Return Before Crash'].iloc[-1],GILDbef['Cumulative Return Before Crash'].iloc[-1],HCAbef['Cumulative Return Before Crash'].iloc[-1],HSICbef['Cumulative Return Before Crash'].iloc[-1],HOLXbef['Cumulative Return Before Crash'].iloc[-1],HUMbef['Cumulative Return Before Crash'].iloc[-1],IDXXbef['Cumulative Return Before Crash'].iloc[-1],ILMNbef['Cumulative Return Before Crash'].iloc[-1],INCYbef['Cumulative Return Before Crash'].iloc[-1],ISRGbef['Cumulative Return Before Crash'].iloc[-1],IQVbef['Cumulative Return Before Crash'].iloc[-1],JNJbef['Cumulative Return Before Crash'].iloc[-1],LHbef['Cumulative Return Before Crash'].iloc[-1],LLYbef['Cumulative Return Before Crash'].iloc[-1],MCKbef['Cumulative Return Before Crash'].iloc[-1],MDTbef['Cumulative Return Before Crash'].iloc[-1],MRKbef['Cumulative Return Before Crash'].iloc[-1],MTDbef['Cumulative Return Before Crash'].iloc[-1],MYLbef['Cumulative Return Before Crash'].iloc[-1],PKIbef['Cumulative Return Before Crash'].iloc[-1],PRGObef['Cumulative Return Before Crash'].iloc[-1],PFEbef['Cumulative Return Before Crash'].iloc[-1],DGXbef['Cumulative Return Before Crash'].iloc[-1],REGNbef['Cumulative Return Before Crash'].iloc[-1],RMDbef['Cumulative Return Before Crash'].iloc[-1],STEbef['Cumulative Return Before Crash'].iloc[-1],SYKbef['Cumulative Return Before Crash'].iloc[-1],TFXbef['Cumulative Return Before Crash'].iloc[-1],TMObef['Cumulative Return Before Crash'].iloc[-1],UNHbef['Cumulative Return Before Crash'].iloc[-1],UHSbef['Cumulative Return Before Crash'].iloc[-1],VARbef['Cumulative Return Before Crash'].iloc[-1],VRTXbef['Cumulative Return Before Crash'].iloc[-1],WATbef['Cumulative Return Before Crash'].iloc[-1],WSTbef['Cumulative Return Before Crash'].iloc[-1],ZBHbef['Cumulative Return Before Crash'].iloc[-1],ZTSbef['Cumulative Return Before Crash'].iloc[-1],AFLbef['Cumulative Return Before Crash'].iloc[-1],ALLbef['Cumulative Return Before Crash'].iloc[-1],AXPbef['Cumulative Return Before Crash'].iloc[-1],AIGbef['Cumulative Return Before Crash'].iloc[-1],AMPbef['Cumulative Return Before Crash'].iloc[-1],AONbef['Cumulative Return Before Crash'].iloc[-1],AJGbef['Cumulative Return Before Crash'].iloc[-1],AIZbef['Cumulative Return Before Crash'].iloc[-1],BACbef['Cumulative Return Before Crash'].iloc[-1],BKbef['Cumulative Return Before Crash'].iloc[-1],BRKBbef['Cumulative Return Before Crash'].iloc[-1],BLKbef['Cumulative Return Before Crash'].iloc[-1],COFbef['Cumulative Return Before Crash'].iloc[-1],CBOEbef['Cumulative Return Before Crash'].iloc[-1],SCHWbef['Cumulative Return Before Crash'].iloc[-1],CBbef['Cumulative Return Before Crash'].iloc[-1],CINFbef['Cumulative Return Before Crash'].iloc[-1],Cbef['Cumulative Return Before Crash'].iloc[-1],CFGbef['Cumulative Return Before Crash'].iloc[-1],CMEbef['Cumulative Return Before Crash'].iloc[-1],CMAbef['Cumulative Return Before Crash'].iloc[-1],DFSbef['Cumulative Return Before Crash'].iloc[-1],ETFCbef['Cumulative Return Before Crash'].iloc[-1],REbef['Cumulative Return Before Crash'].iloc[-1],FITBbef['Cumulative Return Before Crash'].iloc[-1],FRCbef['Cumulative Return Before Crash'].iloc[-1],BENbef['Cumulative Return Before Crash'].iloc[-1],GLbef['Cumulative Return Before Crash'].iloc[-1],GSbef['Cumulative Return Before Crash'].iloc[-1],HIGbef['Cumulative Return Before Crash'].iloc[-1],HBANbef['Cumulative Return Before Crash'].iloc[-1],ICEbef['Cumulative Return Before Crash'].iloc[-1],IVZbef['Cumulative Return Before Crash'].iloc[-1],JPMbef['Cumulative Return Before Crash'].iloc[-1],KEYbef['Cumulative Return Before Crash'].iloc[-1],LNCbef['Cumulative Return Before Crash'].iloc[-1],Lbef['Cumulative Return Before Crash'].iloc[-1],MTBbef['Cumulative Return Before Crash'].iloc[-1],MKTXbef['Cumulative Return Before Crash'].iloc[-1],MMCbef['Cumulative Return Before Crash'].iloc[-1],METbef['Cumulative Return Before Crash'].iloc[-1],MCObef['Cumulative Return Before Crash'].iloc[-1],MSbef['Cumulative Return Before Crash'].iloc[-1],MSCIbef['Cumulative Return Before Crash'].iloc[-1],NDAQbef['Cumulative Return Before Crash'].iloc[-1],NTRSbef['Cumulative Return Before Crash'].iloc[-1],PBCTbef['Cumulative Return Before Crash'].iloc[-1],PNCbef['Cumulative Return Before Crash'].iloc[-1],PFGbef['Cumulative Return Before Crash'].iloc[-1],PGRbef['Cumulative Return Before Crash'].iloc[-1],PRUbef['Cumulative Return Before Crash'].iloc[-1],RJFbef['Cumulative Return Before Crash'].iloc[-1],RFbef['Cumulative Return Before Crash'].iloc[-1],SPGIbef['Cumulative Return Before Crash'].iloc[-1],STTbef['Cumulative Return Before Crash'].iloc[-1],SIVBbef['Cumulative Return Before Crash'].iloc[-1],SYFbef['Cumulative Return Before Crash'].iloc[-1],TROWbef['Cumulative Return Before Crash'].iloc[-1],TRVbef['Cumulative Return Before Crash'].iloc[-1],TFCbef['Cumulative Return Before Crash'].iloc[-1],USBbef['Cumulative Return Before Crash'].iloc[-1],UNMbef['Cumulative Return Before Crash'].iloc[-1],WRBbef['Cumulative Return Before Crash'].iloc[-1],WFCbef['Cumulative Return Before Crash'].iloc[-1],WLTWbef['Cumulative Return Before Crash'].iloc[-1],ZIONbef['Cumulative Return Before Crash'].iloc[-1],ACNbef['Cumulative Return Before Crash'].iloc[-1],ADBEbef['Cumulative Return Before Crash'].iloc[-1],AMDbef['Cumulative Return Before Crash'].iloc[-1],AKAMbef['Cumulative Return Before Crash'].iloc[-1],ADSbef['Cumulative Return Before Crash'].iloc[-1],APHbef['Cumulative Return Before Crash'].iloc[-1],ADIbef['Cumulative Return Before Crash'].iloc[-1],ANSSbef['Cumulative Return Before Crash'].iloc[-1],AAPLbef['Cumulative Return Before Crash'].iloc[-1],AMATbef['Cumulative Return Before Crash'].iloc[-1],ANETbef['Cumulative Return Before Crash'].iloc[-1],ADSKbef['Cumulative Return Before Crash'].iloc[-1],ADPbef['Cumulative Return Before Crash'].iloc[-1],AVGObef['Cumulative Return Before Crash'].iloc[-1],BRbef['Cumulative Return Before Crash'].iloc[-1],CDNSbef['Cumulative Return Before Crash'].iloc[-1],CDWbef['Cumulative Return Before Crash'].iloc[-1],CSCObef['Cumulative Return Before Crash'].iloc[-1],CTXSbef['Cumulative Return Before Crash'].iloc[-1],CTSHbef['Cumulative Return Before Crash'].iloc[-1],GLWbef['Cumulative Return Before Crash'].iloc[-1],DXCbef['Cumulative Return Before Crash'].iloc[-1],FFIVbef['Cumulative Return Before Crash'].iloc[-1],FISbef['Cumulative Return Before Crash'].iloc[-1],FISVbef['Cumulative Return Before Crash'].iloc[-1],FLTbef['Cumulative Return Before Crash'].iloc[-1],FLIRbef['Cumulative Return Before Crash'].iloc[-1],FTNTbef['Cumulative Return Before Crash'].iloc[-1],ITbef['Cumulative Return Before Crash'].iloc[-1],GPNbef['Cumulative Return Before Crash'].iloc[-1],HPEbef['Cumulative Return Before Crash'].iloc[-1],HPQbef['Cumulative Return Before Crash'].iloc[-1],INTCbef['Cumulative Return Before Crash'].iloc[-1],IBMbef['Cumulative Return Before Crash'].iloc[-1],INTUbef['Cumulative Return Before Crash'].iloc[-1],IPGPbef['Cumulative Return Before Crash'].iloc[-1],JKHYbef['Cumulative Return Before Crash'].iloc[-1],JNPRbef['Cumulative Return Before Crash'].iloc[-1],KEYSbef['Cumulative Return Before Crash'].iloc[-1],KLACbef['Cumulative Return Before Crash'].iloc[-1],LRCXbef['Cumulative Return Before Crash'].iloc[-1],LDOSbef['Cumulative Return Before Crash'].iloc[-1],MAbef['Cumulative Return Before Crash'].iloc[-1],MXIMbef['Cumulative Return Before Crash'].iloc[-1],MCHPbef['Cumulative Return Before Crash'].iloc[-1],MUbef['Cumulative Return Before Crash'].iloc[-1],MSFTbef['Cumulative Return Before Crash'].iloc[-1],MSIbef['Cumulative Return Before Crash'].iloc[-1],NTAPbef['Cumulative Return Before Crash'].iloc[-1],NLOKbef['Cumulative Return Before Crash'].iloc[-1],NVDAbef['Cumulative Return Before Crash'].iloc[-1],ORCLbef['Cumulative Return Before Crash'].iloc[-1],PAYXbef['Cumulative Return Before Crash'].iloc[-1],PAYCbef['Cumulative Return Before Crash'].iloc[-1],PYPLbef['Cumulative Return Before Crash'].iloc[-1],QRVObef['Cumulative Return Before Crash'].iloc[-1],QCOMbef['Cumulative Return Before Crash'].iloc[-1],CRMbef['Cumulative Return Before Crash'].iloc[-1],STXbef['Cumulative Return Before Crash'].iloc[-1],NOWbef['Cumulative Return Before Crash'].iloc[-1],SWKSbef['Cumulative Return Before Crash'].iloc[-1],SNPSbef['Cumulative Return Before Crash'].iloc[-1],TELbef['Cumulative Return Before Crash'].iloc[-1],TXNbef['Cumulative Return Before Crash'].iloc[-1],VRSNbef['Cumulative Return Before Crash'].iloc[-1],Vbef['Cumulative Return Before Crash'].iloc[-1],WDCbef['Cumulative Return Before Crash'].iloc[-1],WUbef['Cumulative Return Before Crash'].iloc[-1],XRXbef['Cumulative Return Before Crash'].iloc[-1],XLNXbef['Cumulative Return Before Crash'].iloc[-1],ZBRAbef['Cumulative Return Before Crash'].iloc[-1],ATVIbef['Cumulative Return Before Crash'].iloc[-1],GOOGLbef['Cumulative Return Before Crash'].iloc[-1],GOOGbef['Cumulative Return Before Crash'].iloc[-1],Tbef['Cumulative Return Before Crash'].iloc[-1],CTLbef['Cumulative Return Before Crash'].iloc[-1],CHTRbef['Cumulative Return Before Crash'].iloc[-1],CMCSAbef['Cumulative Return Before Crash'].iloc[-1],DISCAbef['Cumulative Return Before Crash'].iloc[-1],DISCKbef['Cumulative Return Before Crash'].iloc[-1],DISHbef['Cumulative Return Before Crash'].iloc[-1],EAbef['Cumulative Return Before Crash'].iloc[-1],FBbef['Cumulative Return Before Crash'].iloc[-1],FOXAbef['Cumulative Return Before Crash'].iloc[-1],FOXbef['Cumulative Return Before Crash'].iloc[-1],IPGbef['Cumulative Return Before Crash'].iloc[-1],LYVbef['Cumulative Return Before Crash'].iloc[-1],NFLXbef['Cumulative Return Before Crash'].iloc[-1],NWSAbef['Cumulative Return Before Crash'].iloc[-1],NWSbef['Cumulative Return Before Crash'].iloc[-1],OMCbef['Cumulative Return Before Crash'].iloc[-1],TMUSbef['Cumulative Return Before Crash'].iloc[-1],TTWObef['Cumulative Return Before Crash'].iloc[-1],TWTRbef['Cumulative Return Before Crash'].iloc[-1],VZbef['Cumulative Return Before Crash'].iloc[-1],VIACbef['Cumulative Return Before Crash'].iloc[-1],DISbef['Cumulative Return Before Crash'].iloc[-1],AESbef['Cumulative Return Before Crash'].iloc[-1],LNTbef['Cumulative Return Before Crash'].iloc[-1],AEEbef['Cumulative Return Before Crash'].iloc[-1],AEPbef['Cumulative Return Before Crash'].iloc[-1],AWKbef['Cumulative Return Before Crash'].iloc[-1],ATObef['Cumulative Return Before Crash'].iloc[-1],CNPbef['Cumulative Return Before Crash'].iloc[-1],CMSbef['Cumulative Return Before Crash'].iloc[-1],EDbef['Cumulative Return Before Crash'].iloc[-1],Dbef['Cumulative Return Before Crash'].iloc[-1],DTEbef['Cumulative Return Before Crash'].iloc[-1],DUKbef['Cumulative Return Before Crash'].iloc[-1],EIXbef['Cumulative Return Before Crash'].iloc[-1],ETRbef['Cumulative Return Before Crash'].iloc[-1],EVRGbef['Cumulative Return Before Crash'].iloc[-1],ESbef['Cumulative Return Before Crash'].iloc[-1],EXCbef['Cumulative Return Before Crash'].iloc[-1],FEbef['Cumulative Return Before Crash'].iloc[-1],NEEbef['Cumulative Return Before Crash'].iloc[-1],NIbef['Cumulative Return Before Crash'].iloc[-1],NRGbef['Cumulative Return Before Crash'].iloc[-1],PNWbef['Cumulative Return Before Crash'].iloc[-1],PPLbef['Cumulative Return Before Crash'].iloc[-1],PEGbef['Cumulative Return Before Crash'].iloc[-1],SREbef['Cumulative Return Before Crash'].iloc[-1],SObef['Cumulative Return Before Crash'].iloc[-1],WECbef['Cumulative Return Before Crash'].iloc[-1],XELbef['Cumulative Return Before Crash'].iloc[-1],AREbef['Cumulative Return Before Crash'].iloc[-1],AMTbef['Cumulative Return Before Crash'].iloc[-1],AIVbef['Cumulative Return Before Crash'].iloc[-1],AVBbef['Cumulative Return Before Crash'].iloc[-1],BXPbef['Cumulative Return Before Crash'].iloc[-1],CBREbef['Cumulative Return Before Crash'].iloc[-1],CCIbef['Cumulative Return Before Crash'].iloc[-1],DLRbef['Cumulative Return Before Crash'].iloc[-1],DREbef['Cumulative Return Before Crash'].iloc[-1],EQIXbef['Cumulative Return Before Crash'].iloc[-1],EQRbef['Cumulative Return Before Crash'].iloc[-1],ESSbef['Cumulative Return Before Crash'].iloc[-1],EXRbef['Cumulative Return Before Crash'].iloc[-1],FRTbef['Cumulative Return Before Crash'].iloc[-1],PEAKbef['Cumulative Return Before Crash'].iloc[-1],HSTbef['Cumulative Return Before Crash'].iloc[-1],IRMbef['Cumulative Return Before Crash'].iloc[-1],KIMbef['Cumulative Return Before Crash'].iloc[-1],MAAbef['Cumulative Return Before Crash'].iloc[-1],PLDbef['Cumulative Return Before Crash'].iloc[-1],PSAbef['Cumulative Return Before Crash'].iloc[-1],Obef['Cumulative Return Before Crash'].iloc[-1],REGbef['Cumulative Return Before Crash'].iloc[-1],SBACbef['Cumulative Return Before Crash'].iloc[-1],SPGbef['Cumulative Return Before Crash'].iloc[-1],SLGbef['Cumulative Return Before Crash'].iloc[-1],UDRbef['Cumulative Return Before Crash'].iloc[-1],VTRbef['Cumulative Return Before Crash'].iloc[-1],VNObef['Cumulative Return Before Crash'].iloc[-1],WELLbef['Cumulative Return Before Crash'].iloc[-1],WYbef['Cumulative Return Before Crash'].iloc[-1]],
'Cumulative Returns 2/20-3/23': [spdur['Cumulative Return During Crash'].iloc[-1],apachedur['Cumulative Return During Crash'].iloc[-1],bakerdur['Cumulative Return During Crash'].iloc[-1],cabotdur['Cumulative Return During Crash'].iloc[-1],chevrondur['Cumulative Return During Crash'].iloc[-1],conchodur['Cumulative Return During Crash'].iloc[-1],conocodur['Cumulative Return During Crash'].iloc[-1],devondur['Cumulative Return During Crash'].iloc[-1],diamonddur['Cumulative Return During Crash'].iloc[-1],EOGdur['Cumulative Return During Crash'].iloc[-1],exxondur['Cumulative Return During Crash'].iloc[-1],halliburtondur['Cumulative Return During Crash'].iloc[-1],hessdur['Cumulative Return During Crash'].iloc[-1],hollydur['Cumulative Return During Crash'].iloc[-1],kinderdur['Cumulative Return During Crash'].iloc[-1],marathonoildur['Cumulative Return During Crash'].iloc[-1],marathonpetdur['Cumulative Return During Crash'].iloc[-1],nationaldur['Cumulative Return During Crash'].iloc[-1],nobledur['Cumulative Return During Crash'].iloc[-1],occidentaldur['Cumulative Return During Crash'].iloc[-1],oneokdur['Cumulative Return During Crash'].iloc[-1],phillips66dur['Cumulative Return During Crash'].iloc[-1],pioneerdur['Cumulative Return During Crash'].iloc[-1],schlumbergerdur['Cumulative Return During Crash'].iloc[-1],technipdur['Cumulative Return During Crash'].iloc[-1],valerodur['Cumulative Return During Crash'].iloc[-1],williamsdur['Cumulative Return During Crash'].iloc[-1],APDdur['Cumulative Return During Crash'].iloc[-1],ALBdur['Cumulative Return During Crash'].iloc[-1],AMCRdur['Cumulative Return During Crash'].iloc[-1],AVYdur['Cumulative Return During Crash'].iloc[-1],BLLdur['Cumulative Return During Crash'].iloc[-1],CEdur['Cumulative Return During Crash'].iloc[-1],CFdur['Cumulative Return During Crash'].iloc[-1],CTVAdur['Cumulative Return During Crash'].iloc[-1],DOWdur['Cumulative Return During Crash'].iloc[-1],DDdur['Cumulative Return During Crash'].iloc[-1],EMNdur['Cumulative Return During Crash'].iloc[-1],ECLdur['Cumulative Return During Crash'].iloc[-1],FMCdur['Cumulative Return During Crash'].iloc[-1],FCXdur['Cumulative Return During Crash'].iloc[-1],IPdur['Cumulative Return During Crash'].iloc[-1],IFFdur['Cumulative Return During Crash'].iloc[-1],LINdur['Cumulative Return During Crash'].iloc[-1],LYBdur['Cumulative Return During Crash'].iloc[-1],MLMdur['Cumulative Return During Crash'].iloc[-1],MOSdur['Cumulative Return During Crash'].iloc[-1],NEMdur['Cumulative Return During Crash'].iloc[-1],NUEdur['Cumulative Return During Crash'].iloc[-1],PKGdur['Cumulative Return During Crash'].iloc[-1],PPGdur['Cumulative Return During Crash'].iloc[-1],SEEdur['Cumulative Return During Crash'].iloc[-1],SHWdur['Cumulative Return During Crash'].iloc[-1],VMCdur['Cumulative Return During Crash'].iloc[-1],WRKdur['Cumulative Return During Crash'].iloc[-1],MMMdur['Cumulative Return During Crash'].iloc[-1],ALKdur['Cumulative Return During Crash'].iloc[-1],ALLEdur['Cumulative Return During Crash'].iloc[-1],AALdur['Cumulative Return During Crash'].iloc[-1],AMEdur['Cumulative Return During Crash'].iloc[-1],AOSdur['Cumulative Return During Crash'].iloc[-1],BAdur['Cumulative Return During Crash'].iloc[-1],CHRWdur['Cumulative Return During Crash'].iloc[-1],CATdur['Cumulative Return During Crash'].iloc[-1],CTASdur['Cumulative Return During Crash'].iloc[-1],CPRTdur['Cumulative Return During Crash'].iloc[-1],CSXdur['Cumulative Return During Crash'].iloc[-1],CMIdur['Cumulative Return During Crash'].iloc[-1],DEdur['Cumulative Return During Crash'].iloc[-1],DALdur['Cumulative Return During Crash'].iloc[-1],DOVdur['Cumulative Return During Crash'].iloc[-1],ETNdur['Cumulative Return During Crash'].iloc[-1],EMRdur['Cumulative Return During Crash'].iloc[-1],EFXdur['Cumulative Return During Crash'].iloc[-1],EXPDdur['Cumulative Return During Crash'].iloc[-1],FASTdur['Cumulative Return During Crash'].iloc[-1],FDXdur['Cumulative Return During Crash'].iloc[-1],FLSdur['Cumulative Return During Crash'].iloc[-1],FTVdur['Cumulative Return During Crash'].iloc[-1],FBHSdur['Cumulative Return During Crash'].iloc[-1],GDdur['Cumulative Return During Crash'].iloc[-1],GEdur['Cumulative Return During Crash'].iloc[-1],GWWdur['Cumulative Return During Crash'].iloc[-1],HONdur['Cumulative Return During Crash'].iloc[-1],HWMdur['Cumulative Return During Crash'].iloc[-1],HIIdur['Cumulative Return During Crash'].iloc[-1],IEXdur['Cumulative Return During Crash'].iloc[-1],INFOdur['Cumulative Return During Crash'].iloc[-1],ITWdur['Cumulative Return During Crash'].iloc[-1],IRdur['Cumulative Return During Crash'].iloc[-1],Jdur['Cumulative Return During Crash'].iloc[-1],JBHTdur['Cumulative Return During Crash'].iloc[-1],JCIdur['Cumulative Return During Crash'].iloc[-1],KSUdur['Cumulative Return During Crash'].iloc[-1],LHXdur['Cumulative Return During Crash'].iloc[-1],LMTdur['Cumulative Return During Crash'].iloc[-1],MASdur['Cumulative Return During Crash'].iloc[-1],NLSNdur['Cumulative Return During Crash'].iloc[-1],NSCdur['Cumulative Return During Crash'].iloc[-1],NOCdur['Cumulative Return During Crash'].iloc[-1],ODFLdur['Cumulative Return During Crash'].iloc[-1],PCARdur['Cumulative Return During Crash'].iloc[-1],PHdur['Cumulative Return During Crash'].iloc[-1],PNRdur['Cumulative Return During Crash'].iloc[-1],PWRdur['Cumulative Return During Crash'].iloc[-1],RTXdur['Cumulative Return During Crash'].iloc[-1],RSGdur['Cumulative Return During Crash'].iloc[-1],RHIdur['Cumulative Return During Crash'].iloc[-1],ROKdur['Cumulative Return During Crash'].iloc[-1],ROLdur['Cumulative Return During Crash'].iloc[-1],ROPdur['Cumulative Return During Crash'].iloc[-1],SNAdur['Cumulative Return During Crash'].iloc[-1],LUVdur['Cumulative Return During Crash'].iloc[-1],SWKdur['Cumulative Return During Crash'].iloc[-1],TXTdur['Cumulative Return During Crash'].iloc[-1],TTdur['Cumulative Return During Crash'].iloc[-1],TDGdur['Cumulative Return During Crash'].iloc[-1],UNPdur['Cumulative Return During Crash'].iloc[-1],UALdur['Cumulative Return During Crash'].iloc[-1],UPSdur['Cumulative Return During Crash'].iloc[-1],URIdur['Cumulative Return During Crash'].iloc[-1],VRSKdur['Cumulative Return During Crash'].iloc[-1],WABdur['Cumulative Return During Crash'].iloc[-1],WMdur['Cumulative Return During Crash'].iloc[-1],XYLdur['Cumulative Return During Crash'].iloc[-1],AAPdur['Cumulative Return During Crash'].iloc[-1],AMZNdur['Cumulative Return During Crash'].iloc[-1],APTVdur['Cumulative Return During Crash'].iloc[-1],AZOdur['Cumulative Return During Crash'].iloc[-1],BBYdur['Cumulative Return During Crash'].iloc[-1],BKNGdur['Cumulative Return During Crash'].iloc[-1],BWAdur['Cumulative Return During Crash'].iloc[-1],KMXdur['Cumulative Return During Crash'].iloc[-1],CCLdur['Cumulative Return During Crash'].iloc[-1],CMGdur['Cumulative Return During Crash'].iloc[-1],DHIdur['Cumulative Return During Crash'].iloc[-1],DRIdur['Cumulative Return During Crash'].iloc[-1],DGdur['Cumulative Return During Crash'].iloc[-1],DLTRdur['Cumulative Return During Crash'].iloc[-1],DPZdur['Cumulative Return During Crash'].iloc[-1],EBAYdur['Cumulative Return During Crash'].iloc[-1],EXPEdur['Cumulative Return During Crash'].iloc[-1],Fdur['Cumulative Return During Crash'].iloc[-1],GPSdur['Cumulative Return During Crash'].iloc[-1],GRMNdur['Cumulative Return During Crash'].iloc[-1],GMdur['Cumulative Return During Crash'].iloc[-1],GPCdur['Cumulative Return During Crash'].iloc[-1],HRBdur['Cumulative Return During Crash'].iloc[-1],HBIdur['Cumulative Return During Crash'].iloc[-1],HOGdur['Cumulative Return During Crash'].iloc[-1],HASdur['Cumulative Return During Crash'].iloc[-1],HLTdur['Cumulative Return During Crash'].iloc[-1],HDdur['Cumulative Return During Crash'].iloc[-1],KSSdur['Cumulative Return During Crash'].iloc[-1],LBdur['Cumulative Return During Crash'].iloc[-1],LVSdur['Cumulative Return During Crash'].iloc[-1],LEGdur['Cumulative Return During Crash'].iloc[-1],LENdur['Cumulative Return During Crash'].iloc[-1],LKQdur['Cumulative Return During Crash'].iloc[-1],LOWdur['Cumulative Return During Crash'].iloc[-1],MARdur['Cumulative Return During Crash'].iloc[-1],MCDdur['Cumulative Return During Crash'].iloc[-1],MGMdur['Cumulative Return During Crash'].iloc[-1],MHKdur['Cumulative Return During Crash'].iloc[-1],NWLdur['Cumulative Return During Crash'].iloc[-1],NKEdur['Cumulative Return During Crash'].iloc[-1],JWNdur['Cumulative Return During Crash'].iloc[-1],NCLHdur['Cumulative Return During Crash'].iloc[-1],NVRdur['Cumulative Return During Crash'].iloc[-1],ORLYdur['Cumulative Return During Crash'].iloc[-1],PHMdur['Cumulative Return During Crash'].iloc[-1],PVHdur['Cumulative Return During Crash'].iloc[-1],RLdur['Cumulative Return During Crash'].iloc[-1],ROSTdur['Cumulative Return During Crash'].iloc[-1],RCLdur['Cumulative Return During Crash'].iloc[-1],SBUXdur['Cumulative Return During Crash'].iloc[-1],TPRdur['Cumulative Return During Crash'].iloc[-1],TGTdur['Cumulative Return During Crash'].iloc[-1],TIFdur['Cumulative Return During Crash'].iloc[-1],TJXdur['Cumulative Return During Crash'].iloc[-1],TSCOdur['Cumulative Return During Crash'].iloc[-1],ULTAdur['Cumulative Return During Crash'].iloc[-1],UAAdur['Cumulative Return During Crash'].iloc[-1],UAdur['Cumulative Return During Crash'].iloc[-1],VFCdur['Cumulative Return During Crash'].iloc[-1],WHRdur['Cumulative Return During Crash'].iloc[-1],WYNNdur['Cumulative Return During Crash'].iloc[-1],YUMdur['Cumulative Return During Crash'].iloc[-1],MOdur['Cumulative Return During Crash'].iloc[-1],ADMdur['Cumulative Return During Crash'].iloc[-1],BFBdur['Cumulative Return During Crash'].iloc[-1],CPBdur['Cumulative Return During Crash'].iloc[-1],CHDdur['Cumulative Return During Crash'].iloc[-1],CLXdur['Cumulative Return During Crash'].iloc[-1],KOdur['Cumulative Return During Crash'].iloc[-1],CLdur['Cumulative Return During Crash'].iloc[-1],CAGdur['Cumulative Return During Crash'].iloc[-1],STZdur['Cumulative Return During Crash'].iloc[-1],COSTdur['Cumulative Return During Crash'].iloc[-1],COTYdur['Cumulative Return During Crash'].iloc[-1],ELdur['Cumulative Return During Crash'].iloc[-1],GISdur['Cumulative Return During Crash'].iloc[-1],HSYdur['Cumulative Return During Crash'].iloc[-1],HRLdur['Cumulative Return During Crash'].iloc[-1],SJMdur['Cumulative Return During Crash'].iloc[-1],Kdur['Cumulative Return During Crash'].iloc[-1],KMBdur['Cumulative Return During Crash'].iloc[-1],KHCdur['Cumulative Return During Crash'].iloc[-1],KRdur['Cumulative Return During Crash'].iloc[-1],LWdur['Cumulative Return During Crash'].iloc[-1],MKCdur['Cumulative Return During Crash'].iloc[-1],TAPdur['Cumulative Return During Crash'].iloc[-1],MDLZdur['Cumulative Return During Crash'].iloc[-1],MNSTdur['Cumulative Return During Crash'].iloc[-1],PEPdur['Cumulative Return During Crash'].iloc[-1],PMdur['Cumulative Return During Crash'].iloc[-1],PGdur['Cumulative Return During Crash'].iloc[-1],SYYdur['Cumulative Return During Crash'].iloc[-1],TSNdur['Cumulative Return During Crash'].iloc[-1],WMTdur['Cumulative Return During Crash'].iloc[-1],WBAdur['Cumulative Return During Crash'].iloc[-1],ABTdur['Cumulative Return During Crash'].iloc[-1],ABBVdur['Cumulative Return During Crash'].iloc[-1],ABMDdur['Cumulative Return During Crash'].iloc[-1],Adur['Cumulative Return During Crash'].iloc[-1],ALXNdur['Cumulative Return During Crash'].iloc[-1],ALGNdur['Cumulative Return During Crash'].iloc[-1],ABCdur['Cumulative Return During Crash'].iloc[-1],AMGNdur['Cumulative Return During Crash'].iloc[-1],ANTMdur['Cumulative Return During Crash'].iloc[-1],BAXdur['Cumulative Return During Crash'].iloc[-1],BDXdur['Cumulative Return During Crash'].iloc[-1],BIIBdur['Cumulative Return During Crash'].iloc[-1],BSXdur['Cumulative Return During Crash'].iloc[-1],BMYdur['Cumulative Return During Crash'].iloc[-1],CAHdur['Cumulative Return During Crash'].iloc[-1],CNCdur['Cumulative Return During Crash'].iloc[-1],CERNdur['Cumulative Return During Crash'].iloc[-1],CIdur['Cumulative Return During Crash'].iloc[-1],COOdur['Cumulative Return During Crash'].iloc[-1],CVSdur['Cumulative Return During Crash'].iloc[-1],DHRdur['Cumulative Return During Crash'].iloc[-1],DVAdur['Cumulative Return During Crash'].iloc[-1],XRAYdur['Cumulative Return During Crash'].iloc[-1],DXCMdur['Cumulative Return During Crash'].iloc[-1],EWdur['Cumulative Return During Crash'].iloc[-1],GILDdur['Cumulative Return During Crash'].iloc[-1],HCAdur['Cumulative Return During Crash'].iloc[-1],HSICdur['Cumulative Return During Crash'].iloc[-1],HOLXdur['Cumulative Return During Crash'].iloc[-1],HUMdur['Cumulative Return During Crash'].iloc[-1],IDXXdur['Cumulative Return During Crash'].iloc[-1],ILMNdur['Cumulative Return During Crash'].iloc[-1],INCYdur['Cumulative Return During Crash'].iloc[-1],ISRGdur['Cumulative Return During Crash'].iloc[-1],IQVdur['Cumulative Return During Crash'].iloc[-1],JNJdur['Cumulative Return During Crash'].iloc[-1],LHdur['Cumulative Return During Crash'].iloc[-1],LLYdur['Cumulative Return During Crash'].iloc[-1],MCKdur['Cumulative Return During Crash'].iloc[-1],MDTdur['Cumulative Return During Crash'].iloc[-1],MRKdur['Cumulative Return During Crash'].iloc[-1],MTDdur['Cumulative Return During Crash'].iloc[-1],MYLdur['Cumulative Return During Crash'].iloc[-1],PKIdur['Cumulative Return During Crash'].iloc[-1],PRGOdur['Cumulative Return During Crash'].iloc[-1],PFEdur['Cumulative Return During Crash'].iloc[-1],DGXdur['Cumulative Return During Crash'].iloc[-1],REGNdur['Cumulative Return During Crash'].iloc[-1],RMDdur['Cumulative Return During Crash'].iloc[-1],STEdur['Cumulative Return During Crash'].iloc[-1],SYKdur['Cumulative Return During Crash'].iloc[-1],TFXdur['Cumulative Return During Crash'].iloc[-1],TMOdur['Cumulative Return During Crash'].iloc[-1],UNHdur['Cumulative Return During Crash'].iloc[-1],UHSdur['Cumulative Return During Crash'].iloc[-1],VARdur['Cumulative Return During Crash'].iloc[-1],VRTXdur['Cumulative Return During Crash'].iloc[-1],WATdur['Cumulative Return During Crash'].iloc[-1],WSTdur['Cumulative Return During Crash'].iloc[-1],ZBHdur['Cumulative Return During Crash'].iloc[-1],ZTSdur['Cumulative Return During Crash'].iloc[-1],AFLdur['Cumulative Return During Crash'].iloc[-1],ALLdur['Cumulative Return During Crash'].iloc[-1],AXPdur['Cumulative Return During Crash'].iloc[-1],AIGdur['Cumulative Return During Crash'].iloc[-1],AMPdur['Cumulative Return During Crash'].iloc[-1],AONdur['Cumulative Return During Crash'].iloc[-1],AJGdur['Cumulative Return During Crash'].iloc[-1],AIZdur['Cumulative Return During Crash'].iloc[-1],BACdur['Cumulative Return During Crash'].iloc[-1],BKdur['Cumulative Return During Crash'].iloc[-1],BRKBdur['Cumulative Return During Crash'].iloc[-1],BLKdur['Cumulative Return During Crash'].iloc[-1],COFdur['Cumulative Return During Crash'].iloc[-1],CBOEdur['Cumulative Return During Crash'].iloc[-1],SCHWdur['Cumulative Return During Crash'].iloc[-1],CBdur['Cumulative Return During Crash'].iloc[-1],CINFdur['Cumulative Return During Crash'].iloc[-1],Cdur['Cumulative Return During Crash'].iloc[-1],CFGdur['Cumulative Return During Crash'].iloc[-1],CMEdur['Cumulative Return During Crash'].iloc[-1],CMAdur['Cumulative Return During Crash'].iloc[-1],DFSdur['Cumulative Return During Crash'].iloc[-1],ETFCdur['Cumulative Return During Crash'].iloc[-1],REdur['Cumulative Return During Crash'].iloc[-1],FITBdur['Cumulative Return During Crash'].iloc[-1],FRCdur['Cumulative Return During Crash'].iloc[-1],BENdur['Cumulative Return During Crash'].iloc[-1],GLdur['Cumulative Return During Crash'].iloc[-1],GSdur['Cumulative Return During Crash'].iloc[-1],HIGdur['Cumulative Return During Crash'].iloc[-1],HBANdur['Cumulative Return During Crash'].iloc[-1],ICEdur['Cumulative Return During Crash'].iloc[-1],IVZdur['Cumulative Return During Crash'].iloc[-1],JPMdur['Cumulative Return During Crash'].iloc[-1],KEYdur['Cumulative Return During Crash'].iloc[-1],LNCdur['Cumulative Return During Crash'].iloc[-1],Ldur['Cumulative Return During Crash'].iloc[-1],MTBdur['Cumulative Return During Crash'].iloc[-1],MKTXdur['Cumulative Return During Crash'].iloc[-1],MMCdur['Cumulative Return During Crash'].iloc[-1],METdur['Cumulative Return During Crash'].iloc[-1],MCOdur['Cumulative Return During Crash'].iloc[-1],MSdur['Cumulative Return During Crash'].iloc[-1],MSCIdur['Cumulative Return During Crash'].iloc[-1],NDAQdur['Cumulative Return During Crash'].iloc[-1],NTRSdur['Cumulative Return During Crash'].iloc[-1],PBCTdur['Cumulative Return During Crash'].iloc[-1],PNCdur['Cumulative Return During Crash'].iloc[-1],PFGdur['Cumulative Return During Crash'].iloc[-1],PGRdur['Cumulative Return During Crash'].iloc[-1],PRUdur['Cumulative Return During Crash'].iloc[-1],RJFdur['Cumulative Return During Crash'].iloc[-1],RFdur['Cumulative Return During Crash'].iloc[-1],SPGIdur['Cumulative Return During Crash'].iloc[-1],STTdur['Cumulative Return During Crash'].iloc[-1],SIVBdur['Cumulative Return During Crash'].iloc[-1],SYFdur['Cumulative Return During Crash'].iloc[-1],TROWdur['Cumulative Return During Crash'].iloc[-1],TRVdur['Cumulative Return During Crash'].iloc[-1],TFCdur['Cumulative Return During Crash'].iloc[-1],USBdur['Cumulative Return During Crash'].iloc[-1],UNMdur['Cumulative Return During Crash'].iloc[-1],WRBdur['Cumulative Return During Crash'].iloc[-1],WFCdur['Cumulative Return During Crash'].iloc[-1],WLTWdur['Cumulative Return During Crash'].iloc[-1],ZIONdur['Cumulative Return During Crash'].iloc[-1],ACNdur['Cumulative Return During Crash'].iloc[-1],ADBEdur['Cumulative Return During Crash'].iloc[-1],AMDdur['Cumulative Return During Crash'].iloc[-1],AKAMdur['Cumulative Return During Crash'].iloc[-1],ADSdur['Cumulative Return During Crash'].iloc[-1],APHdur['Cumulative Return During Crash'].iloc[-1],ADIdur['Cumulative Return During Crash'].iloc[-1],ANSSdur['Cumulative Return During Crash'].iloc[-1],AAPLdur['Cumulative Return During Crash'].iloc[-1],AMATdur['Cumulative Return During Crash'].iloc[-1],ANETdur['Cumulative Return During Crash'].iloc[-1],ADSKdur['Cumulative Return During Crash'].iloc[-1],ADPdur['Cumulative Return During Crash'].iloc[-1],AVGOdur['Cumulative Return During Crash'].iloc[-1],BRdur['Cumulative Return During Crash'].iloc[-1],CDNSdur['Cumulative Return During Crash'].iloc[-1],CDWdur['Cumulative Return During Crash'].iloc[-1],CSCOdur['Cumulative Return During Crash'].iloc[-1],CTXSdur['Cumulative Return During Crash'].iloc[-1],CTSHdur['Cumulative Return During Crash'].iloc[-1],GLWdur['Cumulative Return During Crash'].iloc[-1],DXCdur['Cumulative Return During Crash'].iloc[-1],FFIVdur['Cumulative Return During Crash'].iloc[-1],FISdur['Cumulative Return During Crash'].iloc[-1],FISVdur['Cumulative Return During Crash'].iloc[-1],FLTdur['Cumulative Return During Crash'].iloc[-1],FLIRdur['Cumulative Return During Crash'].iloc[-1],FTNTdur['Cumulative Return During Crash'].iloc[-1],ITdur['Cumulative Return During Crash'].iloc[-1],GPNdur['Cumulative Return During Crash'].iloc[-1],HPEdur['Cumulative Return During Crash'].iloc[-1],HPQdur['Cumulative Return During Crash'].iloc[-1],INTCdur['Cumulative Return During Crash'].iloc[-1],IBMdur['Cumulative Return During Crash'].iloc[-1],INTUdur['Cumulative Return During Crash'].iloc[-1],IPGPdur['Cumulative Return During Crash'].iloc[-1],JKHYdur['Cumulative Return During Crash'].iloc[-1],JNPRdur['Cumulative Return During Crash'].iloc[-1],KEYSdur['Cumulative Return During Crash'].iloc[-1],KLACdur['Cumulative Return During Crash'].iloc[-1],LRCXdur['Cumulative Return During Crash'].iloc[-1],LDOSdur['Cumulative Return During Crash'].iloc[-1],MAdur['Cumulative Return During Crash'].iloc[-1],MXIMdur['Cumulative Return During Crash'].iloc[-1],MCHPdur['Cumulative Return During Crash'].iloc[-1],MUdur['Cumulative Return During Crash'].iloc[-1],MSFTdur['Cumulative Return During Crash'].iloc[-1],MSIdur['Cumulative Return During Crash'].iloc[-1],NTAPdur['Cumulative Return During Crash'].iloc[-1],NLOKdur['Cumulative Return During Crash'].iloc[-1],NVDAdur['Cumulative Return During Crash'].iloc[-1],ORCLdur['Cumulative Return During Crash'].iloc[-1],PAYXdur['Cumulative Return During Crash'].iloc[-1],PAYCdur['Cumulative Return During Crash'].iloc[-1],PYPLdur['Cumulative Return During Crash'].iloc[-1],QRVOdur['Cumulative Return During Crash'].iloc[-1],QCOMdur['Cumulative Return During Crash'].iloc[-1],CRMdur['Cumulative Return During Crash'].iloc[-1],STXdur['Cumulative Return During Crash'].iloc[-1],NOWdur['Cumulative Return During Crash'].iloc[-1],SWKSdur['Cumulative Return During Crash'].iloc[-1],SNPSdur['Cumulative Return During Crash'].iloc[-1],TELdur['Cumulative Return During Crash'].iloc[-1],TXNdur['Cumulative Return During Crash'].iloc[-1],VRSNdur['Cumulative Return During Crash'].iloc[-1],Vdur['Cumulative Return During Crash'].iloc[-1],WDCdur['Cumulative Return During Crash'].iloc[-1],WUdur['Cumulative Return During Crash'].iloc[-1],XRXdur['Cumulative Return During Crash'].iloc[-1],XLNXdur['Cumulative Return During Crash'].iloc[-1],ZBRAdur['Cumulative Return During Crash'].iloc[-1],ATVIdur['Cumulative Return During Crash'].iloc[-1],GOOGLdur['Cumulative Return During Crash'].iloc[-1],GOOGdur['Cumulative Return During Crash'].iloc[-1],Tdur['Cumulative Return During Crash'].iloc[-1],CTLdur['Cumulative Return During Crash'].iloc[-1],CHTRdur['Cumulative Return During Crash'].iloc[-1],CMCSAdur['Cumulative Return During Crash'].iloc[-1],DISCAdur['Cumulative Return During Crash'].iloc[-1],DISCKdur['Cumulative Return During Crash'].iloc[-1],DISHdur['Cumulative Return During Crash'].iloc[-1],EAdur['Cumulative Return During Crash'].iloc[-1],FBdur['Cumulative Return During Crash'].iloc[-1],FOXAdur['Cumulative Return During Crash'].iloc[-1],FOXdur['Cumulative Return During Crash'].iloc[-1],IPGdur['Cumulative Return During Crash'].iloc[-1],LYVdur['Cumulative Return During Crash'].iloc[-1],NFLXdur['Cumulative Return During Crash'].iloc[-1],NWSAdur['Cumulative Return During Crash'].iloc[-1],NWSdur['Cumulative Return During Crash'].iloc[-1],OMCdur['Cumulative Return During Crash'].iloc[-1],TMUSdur['Cumulative Return During Crash'].iloc[-1],TTWOdur['Cumulative Return During Crash'].iloc[-1],TWTRdur['Cumulative Return During Crash'].iloc[-1],VZdur['Cumulative Return During Crash'].iloc[-1],VIACdur['Cumulative Return During Crash'].iloc[-1],DISdur['Cumulative Return During Crash'].iloc[-1],AESdur['Cumulative Return During Crash'].iloc[-1],LNTdur['Cumulative Return During Crash'].iloc[-1],AEEdur['Cumulative Return During Crash'].iloc[-1],AEPdur['Cumulative Return During Crash'].iloc[-1],AWKdur['Cumulative Return During Crash'].iloc[-1],ATOdur['Cumulative Return During Crash'].iloc[-1],CNPdur['Cumulative Return During Crash'].iloc[-1],CMSdur['Cumulative Return During Crash'].iloc[-1],EDdur['Cumulative Return During Crash'].iloc[-1],Ddur['Cumulative Return During Crash'].iloc[-1],DTEdur['Cumulative Return During Crash'].iloc[-1],DUKdur['Cumulative Return During Crash'].iloc[-1],EIXdur['Cumulative Return During Crash'].iloc[-1],ETRdur['Cumulative Return During Crash'].iloc[-1],EVRGdur['Cumulative Return During Crash'].iloc[-1],ESdur['Cumulative Return During Crash'].iloc[-1],EXCdur['Cumulative Return During Crash'].iloc[-1],FEdur['Cumulative Return During Crash'].iloc[-1],NEEdur['Cumulative Return During Crash'].iloc[-1],NIdur['Cumulative Return During Crash'].iloc[-1],NRGdur['Cumulative Return During Crash'].iloc[-1],PNWdur['Cumulative Return During Crash'].iloc[-1],PPLdur['Cumulative Return During Crash'].iloc[-1],PEGdur['Cumulative Return During Crash'].iloc[-1],SREdur['Cumulative Return During Crash'].iloc[-1],SOdur['Cumulative Return During Crash'].iloc[-1],WECdur['Cumulative Return During Crash'].iloc[-1],XELdur['Cumulative Return During Crash'].iloc[-1],AREdur['Cumulative Return During Crash'].iloc[-1],AMTdur['Cumulative Return During Crash'].iloc[-1],AIVdur['Cumulative Return During Crash'].iloc[-1],AVBdur['Cumulative Return During Crash'].iloc[-1],BXPdur['Cumulative Return During Crash'].iloc[-1],CBREdur['Cumulative Return During Crash'].iloc[-1],CCIdur['Cumulative Return During Crash'].iloc[-1],DLRdur['Cumulative Return During Crash'].iloc[-1],DREdur['Cumulative Return During Crash'].iloc[-1],EQIXdur['Cumulative Return During Crash'].iloc[-1],EQRdur['Cumulative Return During Crash'].iloc[-1],ESSdur['Cumulative Return During Crash'].iloc[-1],EXRdur['Cumulative Return During Crash'].iloc[-1],FRTdur['Cumulative Return During Crash'].iloc[-1],PEAKdur['Cumulative Return During Crash'].iloc[-1],HSTdur['Cumulative Return During Crash'].iloc[-1],IRMdur['Cumulative Return During Crash'].iloc[-1],KIMdur['Cumulative Return During Crash'].iloc[-1],MAAdur['Cumulative Return During Crash'].iloc[-1],PLDdur['Cumulative Return During Crash'].iloc[-1],PSAdur['Cumulative Return During Crash'].iloc[-1],Odur['Cumulative Return During Crash'].iloc[-1],REGdur['Cumulative Return During Crash'].iloc[-1],SBACdur['Cumulative Return During Crash'].iloc[-1],SPGdur['Cumulative Return During Crash'].iloc[-1],SLGdur['Cumulative Return During Crash'].iloc[-1],UDRdur['Cumulative Return During Crash'].iloc[-1],VTRdur['Cumulative Return During Crash'].iloc[-1],VNOdur['Cumulative Return During Crash'].iloc[-1],WELLdur['Cumulative Return During Crash'].iloc[-1],WYdur['Cumulative Return During Crash'].iloc[-1]],
'Cumulative Returns 3/23-6/5': [spaft['Cumulative Return After Crash'].iloc[-1],apacheaft['Cumulative Return After Crash'].iloc[-1],bakeraft['Cumulative Return After Crash'].iloc[-1],cabotaft['Cumulative Return After Crash'].iloc[-1],chevronaft['Cumulative Return After Crash'].iloc[-1],conchoaft['Cumulative Return After Crash'].iloc[-1],conocoaft['Cumulative Return After Crash'].iloc[-1],devonaft['Cumulative Return After Crash'].iloc[-1],diamondaft['Cumulative Return After Crash'].iloc[-1],EOGaft['Cumulative Return After Crash'].iloc[-1],exxonaft['Cumulative Return After Crash'].iloc[-1],halliburtonaft['Cumulative Return After Crash'].iloc[-1],hessaft['Cumulative Return After Crash'].iloc[-1],hollyaft['Cumulative Return After Crash'].iloc[-1],kinderaft['Cumulative Return After Crash'].iloc[-1],marathonoilaft['Cumulative Return After Crash'].iloc[-1],marathonpetaft['Cumulative Return After Crash'].iloc[-1],nationalaft['Cumulative Return After Crash'].iloc[-1],nobleaft['Cumulative Return After Crash'].iloc[-1],occidentalaft['Cumulative Return After Crash'].iloc[-1],oneokaft['Cumulative Return After Crash'].iloc[-1],phillips66aft['Cumulative Return After Crash'].iloc[-1],pioneeraft['Cumulative Return After Crash'].iloc[-1],schlumbergeraft['Cumulative Return After Crash'].iloc[-1],technipaft['Cumulative Return After Crash'].iloc[-1],valeroaft['Cumulative Return After Crash'].iloc[-1],williamsaft['Cumulative Return After Crash'].iloc[-1],APDaft['Cumulative Return After Crash'].iloc[-1],ALBaft['Cumulative Return After Crash'].iloc[-1],AMCRaft['Cumulative Return After Crash'].iloc[-1],AVYaft['Cumulative Return After Crash'].iloc[-1],BLLaft['Cumulative Return After Crash'].iloc[-1],CEaft['Cumulative Return After Crash'].iloc[-1],CFaft['Cumulative Return After Crash'].iloc[-1],CTVAaft['Cumulative Return After Crash'].iloc[-1],DOWaft['Cumulative Return After Crash'].iloc[-1],DDaft['Cumulative Return After Crash'].iloc[-1],EMNaft['Cumulative Return After Crash'].iloc[-1],ECLaft['Cumulative Return After Crash'].iloc[-1],FMCaft['Cumulative Return After Crash'].iloc[-1],FCXaft['Cumulative Return After Crash'].iloc[-1],IPaft['Cumulative Return After Crash'].iloc[-1],IFFaft['Cumulative Return After Crash'].iloc[-1],LINaft['Cumulative Return After Crash'].iloc[-1],LYBaft['Cumulative Return After Crash'].iloc[-1],MLMaft['Cumulative Return After Crash'].iloc[-1],MOSaft['Cumulative Return After Crash'].iloc[-1],NEMaft['Cumulative Return After Crash'].iloc[-1],NUEaft['Cumulative Return After Crash'].iloc[-1],PKGaft['Cumulative Return After Crash'].iloc[-1],PPGaft['Cumulative Return After Crash'].iloc[-1],SEEaft['Cumulative Return After Crash'].iloc[-1],SHWaft['Cumulative Return After Crash'].iloc[-1],VMCaft['Cumulative Return After Crash'].iloc[-1],WRKaft['Cumulative Return After Crash'].iloc[-1],MMMaft['Cumulative Return After Crash'].iloc[-1],ALKaft['Cumulative Return After Crash'].iloc[-1],ALLEaft['Cumulative Return After Crash'].iloc[-1],AALaft['Cumulative Return After Crash'].iloc[-1],AMEaft['Cumulative Return After Crash'].iloc[-1],AOSaft['Cumulative Return After Crash'].iloc[-1],BAaft['Cumulative Return After Crash'].iloc[-1],CHRWaft['Cumulative Return After Crash'].iloc[-1],CATaft['Cumulative Return After Crash'].iloc[-1],CTASaft['Cumulative Return After Crash'].iloc[-1],CPRTaft['Cumulative Return After Crash'].iloc[-1],CSXaft['Cumulative Return After Crash'].iloc[-1],CMIaft['Cumulative Return After Crash'].iloc[-1],DEaft['Cumulative Return After Crash'].iloc[-1],DALaft['Cumulative Return After Crash'].iloc[-1],DOVaft['Cumulative Return After Crash'].iloc[-1],ETNaft['Cumulative Return After Crash'].iloc[-1],EMRaft['Cumulative Return After Crash'].iloc[-1],EFXaft['Cumulative Return After Crash'].iloc[-1],EXPDaft['Cumulative Return After Crash'].iloc[-1],FASTaft['Cumulative Return After Crash'].iloc[-1],FDXaft['Cumulative Return After Crash'].iloc[-1],FLSaft['Cumulative Return After Crash'].iloc[-1],FTVaft['Cumulative Return After Crash'].iloc[-1],FBHSaft['Cumulative Return After Crash'].iloc[-1],GDaft['Cumulative Return After Crash'].iloc[-1],GEaft['Cumulative Return After Crash'].iloc[-1],GWWaft['Cumulative Return After Crash'].iloc[-1],HONaft['Cumulative Return After Crash'].iloc[-1],HWMaft['Cumulative Return After Crash'].iloc[-1],HIIaft['Cumulative Return After Crash'].iloc[-1],IEXaft['Cumulative Return After Crash'].iloc[-1],INFOaft['Cumulative Return After Crash'].iloc[-1],ITWaft['Cumulative Return After Crash'].iloc[-1],IRaft['Cumulative Return After Crash'].iloc[-1],Jaft['Cumulative Return After Crash'].iloc[-1],JBHTaft['Cumulative Return After Crash'].iloc[-1],JCIaft['Cumulative Return After Crash'].iloc[-1],KSUaft['Cumulative Return After Crash'].iloc[-1],LHXaft['Cumulative Return After Crash'].iloc[-1],LMTaft['Cumulative Return After Crash'].iloc[-1],MASaft['Cumulative Return After Crash'].iloc[-1],NLSNaft['Cumulative Return After Crash'].iloc[-1],NSCaft['Cumulative Return After Crash'].iloc[-1],NOCaft['Cumulative Return After Crash'].iloc[-1],ODFLaft['Cumulative Return After Crash'].iloc[-1],PCARaft['Cumulative Return After Crash'].iloc[-1],PHaft['Cumulative Return After Crash'].iloc[-1],PNRaft['Cumulative Return After Crash'].iloc[-1],PWRaft['Cumulative Return After Crash'].iloc[-1],RTXaft['Cumulative Return After Crash'].iloc[-1],RSGaft['Cumulative Return After Crash'].iloc[-1],RHIaft['Cumulative Return After Crash'].iloc[-1],ROKaft['Cumulative Return After Crash'].iloc[-1],ROLaft['Cumulative Return After Crash'].iloc[-1],ROPaft['Cumulative Return After Crash'].iloc[-1],SNAaft['Cumulative Return After Crash'].iloc[-1],LUVaft['Cumulative Return After Crash'].iloc[-1],SWKaft['Cumulative Return After Crash'].iloc[-1],TXTaft['Cumulative Return After Crash'].iloc[-1],TTaft['Cumulative Return After Crash'].iloc[-1],TDGaft['Cumulative Return After Crash'].iloc[-1],UNPaft['Cumulative Return After Crash'].iloc[-1],UALaft['Cumulative Return After Crash'].iloc[-1],UPSaft['Cumulative Return After Crash'].iloc[-1],URIaft['Cumulative Return After Crash'].iloc[-1],VRSKaft['Cumulative Return After Crash'].iloc[-1],WABaft['Cumulative Return After Crash'].iloc[-1],WMaft['Cumulative Return After Crash'].iloc[-1],XYLaft['Cumulative Return After Crash'].iloc[-1],AAPaft['Cumulative Return After Crash'].iloc[-1],AMZNaft['Cumulative Return After Crash'].iloc[-1],APTVaft['Cumulative Return After Crash'].iloc[-1],AZOaft['Cumulative Return After Crash'].iloc[-1],BBYaft['Cumulative Return After Crash'].iloc[-1],BKNGaft['Cumulative Return After Crash'].iloc[-1],BWAaft['Cumulative Return After Crash'].iloc[-1],KMXaft['Cumulative Return After Crash'].iloc[-1],CCLaft['Cumulative Return After Crash'].iloc[-1],CMGaft['Cumulative Return After Crash'].iloc[-1],DHIaft['Cumulative Return After Crash'].iloc[-1],DRIaft['Cumulative Return After Crash'].iloc[-1],DGaft['Cumulative Return After Crash'].iloc[-1],DLTRaft['Cumulative Return After Crash'].iloc[-1],DPZaft['Cumulative Return After Crash'].iloc[-1],EBAYaft['Cumulative Return After Crash'].iloc[-1],EXPEaft['Cumulative Return After Crash'].iloc[-1],Faft['Cumulative Return After Crash'].iloc[-1],GPSaft['Cumulative Return After Crash'].iloc[-1],GRMNaft['Cumulative Return After Crash'].iloc[-1],GMaft['Cumulative Return After Crash'].iloc[-1],GPCaft['Cumulative Return After Crash'].iloc[-1],HRBaft['Cumulative Return After Crash'].iloc[-1],HBIaft['Cumulative Return After Crash'].iloc[-1],HOGaft['Cumulative Return After Crash'].iloc[-1],HASaft['Cumulative Return After Crash'].iloc[-1],HLTaft['Cumulative Return After Crash'].iloc[-1],HDaft['Cumulative Return After Crash'].iloc[-1],KSSaft['Cumulative Return After Crash'].iloc[-1],LBaft['Cumulative Return After Crash'].iloc[-1],LVSaft['Cumulative Return After Crash'].iloc[-1],LEGaft['Cumulative Return After Crash'].iloc[-1],LENaft['Cumulative Return After Crash'].iloc[-1],LKQaft['Cumulative Return After Crash'].iloc[-1],LOWaft['Cumulative Return After Crash'].iloc[-1],MARaft['Cumulative Return After Crash'].iloc[-1],MCDaft['Cumulative Return After Crash'].iloc[-1],MGMaft['Cumulative Return After Crash'].iloc[-1],MHKaft['Cumulative Return After Crash'].iloc[-1],NWLaft['Cumulative Return After Crash'].iloc[-1],NKEaft['Cumulative Return After Crash'].iloc[-1],JWNaft['Cumulative Return After Crash'].iloc[-1],NCLHaft['Cumulative Return After Crash'].iloc[-1],NVRaft['Cumulative Return After Crash'].iloc[-1],ORLYaft['Cumulative Return After Crash'].iloc[-1],PHMaft['Cumulative Return After Crash'].iloc[-1],PVHaft['Cumulative Return After Crash'].iloc[-1],RLaft['Cumulative Return After Crash'].iloc[-1],ROSTaft['Cumulative Return After Crash'].iloc[-1],RCLaft['Cumulative Return After Crash'].iloc[-1],SBUXaft['Cumulative Return After Crash'].iloc[-1],TPRaft['Cumulative Return After Crash'].iloc[-1],TGTaft['Cumulative Return After Crash'].iloc[-1],TIFaft['Cumulative Return After Crash'].iloc[-1],TJXaft['Cumulative Return After Crash'].iloc[-1],TSCOaft['Cumulative Return After Crash'].iloc[-1],ULTAaft['Cumulative Return After Crash'].iloc[-1],UAAaft['Cumulative Return After Crash'].iloc[-1],UAaft['Cumulative Return After Crash'].iloc[-1],VFCaft['Cumulative Return After Crash'].iloc[-1],WHRaft['Cumulative Return After Crash'].iloc[-1],WYNNaft['Cumulative Return After Crash'].iloc[-1],YUMaft['Cumulative Return After Crash'].iloc[-1],MOaft['Cumulative Return After Crash'].iloc[-1],ADMaft['Cumulative Return After Crash'].iloc[-1],BFBaft['Cumulative Return After Crash'].iloc[-1],CPBaft['Cumulative Return After Crash'].iloc[-1],CHDaft['Cumulative Return After Crash'].iloc[-1],CLXaft['Cumulative Return After Crash'].iloc[-1],KOaft['Cumulative Return After Crash'].iloc[-1],CLaft['Cumulative Return After Crash'].iloc[-1],CAGaft['Cumulative Return After Crash'].iloc[-1],STZaft['Cumulative Return After Crash'].iloc[-1],COSTaft['Cumulative Return After Crash'].iloc[-1],COTYaft['Cumulative Return After Crash'].iloc[-1],ELaft['Cumulative Return After Crash'].iloc[-1],GISaft['Cumulative Return After Crash'].iloc[-1],HSYaft['Cumulative Return After Crash'].iloc[-1],HRLaft['Cumulative Return After Crash'].iloc[-1],SJMaft['Cumulative Return After Crash'].iloc[-1],Kaft['Cumulative Return After Crash'].iloc[-1],KMBaft['Cumulative Return After Crash'].iloc[-1],KHCaft['Cumulative Return After Crash'].iloc[-1],KRaft['Cumulative Return After Crash'].iloc[-1],LWaft['Cumulative Return After Crash'].iloc[-1],MKCaft['Cumulative Return After Crash'].iloc[-1],TAPaft['Cumulative Return After Crash'].iloc[-1],MDLZaft['Cumulative Return After Crash'].iloc[-1],MNSTaft['Cumulative Return After Crash'].iloc[-1],PEPaft['Cumulative Return After Crash'].iloc[-1],PMaft['Cumulative Return After Crash'].iloc[-1],PGaft['Cumulative Return After Crash'].iloc[-1],SYYaft['Cumulative Return After Crash'].iloc[-1],TSNaft['Cumulative Return After Crash'].iloc[-1],WMTaft['Cumulative Return After Crash'].iloc[-1],WBAaft['Cumulative Return After Crash'].iloc[-1],ABTaft['Cumulative Return After Crash'].iloc[-1],ABBVaft['Cumulative Return After Crash'].iloc[-1],ABMDaft['Cumulative Return After Crash'].iloc[-1],Aaft['Cumulative Return After Crash'].iloc[-1],ALXNaft['Cumulative Return After Crash'].iloc[-1],ALGNaft['Cumulative Return After Crash'].iloc[-1],ABCaft['Cumulative Return After Crash'].iloc[-1],AMGNaft['Cumulative Return After Crash'].iloc[-1],ANTMaft['Cumulative Return After Crash'].iloc[-1],BAXaft['Cumulative Return After Crash'].iloc[-1],BDXaft['Cumulative Return After Crash'].iloc[-1],BIIBaft['Cumulative Return After Crash'].iloc[-1],BSXaft['Cumulative Return After Crash'].iloc[-1],BMYaft['Cumulative Return After Crash'].iloc[-1],CAHaft['Cumulative Return After Crash'].iloc[-1],CNCaft['Cumulative Return After Crash'].iloc[-1],CERNaft['Cumulative Return After Crash'].iloc[-1],CIaft['Cumulative Return After Crash'].iloc[-1],COOaft['Cumulative Return After Crash'].iloc[-1],CVSaft['Cumulative Return After Crash'].iloc[-1],DHRaft['Cumulative Return After Crash'].iloc[-1],DVAaft['Cumulative Return After Crash'].iloc[-1],XRAYaft['Cumulative Return After Crash'].iloc[-1],DXCMaft['Cumulative Return After Crash'].iloc[-1],EWaft['Cumulative Return After Crash'].iloc[-1],GILDaft['Cumulative Return After Crash'].iloc[-1],HCAaft['Cumulative Return After Crash'].iloc[-1],HSICaft['Cumulative Return After Crash'].iloc[-1],HOLXaft['Cumulative Return After Crash'].iloc[-1],HUMaft['Cumulative Return After Crash'].iloc[-1],IDXXaft['Cumulative Return After Crash'].iloc[-1],ILMNaft['Cumulative Return After Crash'].iloc[-1],INCYaft['Cumulative Return After Crash'].iloc[-1],ISRGaft['Cumulative Return After Crash'].iloc[-1],IQVaft['Cumulative Return After Crash'].iloc[-1],JNJaft['Cumulative Return After Crash'].iloc[-1],LHaft['Cumulative Return After Crash'].iloc[-1],LLYaft['Cumulative Return After Crash'].iloc[-1],MCKaft['Cumulative Return After Crash'].iloc[-1],MDTaft['Cumulative Return After Crash'].iloc[-1],MRKaft['Cumulative Return After Crash'].iloc[-1],MTDaft['Cumulative Return After Crash'].iloc[-1],MYLaft['Cumulative Return After Crash'].iloc[-1],PKIaft['Cumulative Return After Crash'].iloc[-1],PRGOaft['Cumulative Return After Crash'].iloc[-1],PFEaft['Cumulative Return After Crash'].iloc[-1],DGXaft['Cumulative Return After Crash'].iloc[-1],REGNaft['Cumulative Return After Crash'].iloc[-1],RMDaft['Cumulative Return After Crash'].iloc[-1],STEaft['Cumulative Return After Crash'].iloc[-1],SYKaft['Cumulative Return After Crash'].iloc[-1],TFXaft['Cumulative Return After Crash'].iloc[-1],TMOaft['Cumulative Return After Crash'].iloc[-1],UNHaft['Cumulative Return After Crash'].iloc[-1],UHSaft['Cumulative Return After Crash'].iloc[-1],VARaft['Cumulative Return After Crash'].iloc[-1],VRTXaft['Cumulative Return After Crash'].iloc[-1],WATaft['Cumulative Return After Crash'].iloc[-1],WSTaft['Cumulative Return After Crash'].iloc[-1],ZBHaft['Cumulative Return After Crash'].iloc[-1],ZTSaft['Cumulative Return After Crash'].iloc[-1],AFLaft['Cumulative Return After Crash'].iloc[-1],ALLaft['Cumulative Return After Crash'].iloc[-1],AXPaft['Cumulative Return After Crash'].iloc[-1],AIGaft['Cumulative Return After Crash'].iloc[-1],AMPaft['Cumulative Return After Crash'].iloc[-1],AONaft['Cumulative Return After Crash'].iloc[-1],AJGaft['Cumulative Return After Crash'].iloc[-1],AIZaft['Cumulative Return After Crash'].iloc[-1],BACaft['Cumulative Return After Crash'].iloc[-1],BKaft['Cumulative Return After Crash'].iloc[-1],BRKBaft['Cumulative Return After Crash'].iloc[-1],BLKaft['Cumulative Return After Crash'].iloc[-1],COFaft['Cumulative Return After Crash'].iloc[-1],CBOEaft['Cumulative Return After Crash'].iloc[-1],SCHWaft['Cumulative Return After Crash'].iloc[-1],CBaft['Cumulative Return After Crash'].iloc[-1],CINFaft['Cumulative Return After Crash'].iloc[-1],Caft['Cumulative Return After Crash'].iloc[-1],CFGaft['Cumulative Return After Crash'].iloc[-1],CMEaft['Cumulative Return After Crash'].iloc[-1],CMAaft['Cumulative Return After Crash'].iloc[-1],DFSaft['Cumulative Return After Crash'].iloc[-1],ETFCaft['Cumulative Return After Crash'].iloc[-1],REaft['Cumulative Return After Crash'].iloc[-1],FITBaft['Cumulative Return After Crash'].iloc[-1],FRCaft['Cumulative Return After Crash'].iloc[-1],BENaft['Cumulative Return After Crash'].iloc[-1],GLaft['Cumulative Return After Crash'].iloc[-1],GSaft['Cumulative Return After Crash'].iloc[-1],HIGaft['Cumulative Return After Crash'].iloc[-1],HBANaft['Cumulative Return After Crash'].iloc[-1],ICEaft['Cumulative Return After Crash'].iloc[-1],IVZaft['Cumulative Return After Crash'].iloc[-1],JPMaft['Cumulative Return After Crash'].iloc[-1],KEYaft['Cumulative Return After Crash'].iloc[-1],LNCaft['Cumulative Return After Crash'].iloc[-1],Laft['Cumulative Return After Crash'].iloc[-1],MTBaft['Cumulative Return After Crash'].iloc[-1],MKTXaft['Cumulative Return After Crash'].iloc[-1],MMCaft['Cumulative Return After Crash'].iloc[-1],METaft['Cumulative Return After Crash'].iloc[-1],MCOaft['Cumulative Return After Crash'].iloc[-1],MSaft['Cumulative Return After Crash'].iloc[-1],MSCIaft['Cumulative Return After Crash'].iloc[-1],NDAQaft['Cumulative Return After Crash'].iloc[-1],NTRSaft['Cumulative Return After Crash'].iloc[-1],PBCTaft['Cumulative Return After Crash'].iloc[-1],PNCaft['Cumulative Return After Crash'].iloc[-1],PFGaft['Cumulative Return After Crash'].iloc[-1],PGRaft['Cumulative Return After Crash'].iloc[-1],PRUaft['Cumulative Return After Crash'].iloc[-1],RJFaft['Cumulative Return After Crash'].iloc[-1],RFaft['Cumulative Return After Crash'].iloc[-1],SPGIaft['Cumulative Return After Crash'].iloc[-1],STTaft['Cumulative Return After Crash'].iloc[-1],SIVBaft['Cumulative Return After Crash'].iloc[-1],SYFaft['Cumulative Return After Crash'].iloc[-1],TROWaft['Cumulative Return After Crash'].iloc[-1],TRVaft['Cumulative Return After Crash'].iloc[-1],TFCaft['Cumulative Return After Crash'].iloc[-1],USBaft['Cumulative Return After Crash'].iloc[-1],UNMaft['Cumulative Return After Crash'].iloc[-1],WRBaft['Cumulative Return After Crash'].iloc[-1],WFCaft['Cumulative Return After Crash'].iloc[-1],WLTWaft['Cumulative Return After Crash'].iloc[-1],ZIONaft['Cumulative Return After Crash'].iloc[-1],ACNaft['Cumulative Return After Crash'].iloc[-1],ADBEaft['Cumulative Return After Crash'].iloc[-1],AMDaft['Cumulative Return After Crash'].iloc[-1],AKAMaft['Cumulative Return After Crash'].iloc[-1],ADSaft['Cumulative Return After Crash'].iloc[-1],APHaft['Cumulative Return After Crash'].iloc[-1],ADIaft['Cumulative Return After Crash'].iloc[-1],ANSSaft['Cumulative Return After Crash'].iloc[-1],AAPLaft['Cumulative Return After Crash'].iloc[-1],AMATaft['Cumulative Return After Crash'].iloc[-1],ANETaft['Cumulative Return After Crash'].iloc[-1],ADSKaft['Cumulative Return After Crash'].iloc[-1],ADPaft['Cumulative Return After Crash'].iloc[-1],AVGOaft['Cumulative Return After Crash'].iloc[-1],BRaft['Cumulative Return After Crash'].iloc[-1],CDNSaft['Cumulative Return After Crash'].iloc[-1],CDWaft['Cumulative Return After Crash'].iloc[-1],CSCOaft['Cumulative Return After Crash'].iloc[-1],CTXSaft['Cumulative Return After Crash'].iloc[-1],CTSHaft['Cumulative Return After Crash'].iloc[-1],GLWaft['Cumulative Return After Crash'].iloc[-1],DXCaft['Cumulative Return After Crash'].iloc[-1],FFIVaft['Cumulative Return After Crash'].iloc[-1],FISaft['Cumulative Return After Crash'].iloc[-1],FISVaft['Cumulative Return After Crash'].iloc[-1],FLTaft['Cumulative Return After Crash'].iloc[-1],FLIRaft['Cumulative Return After Crash'].iloc[-1],FTNTaft['Cumulative Return After Crash'].iloc[-1],ITaft['Cumulative Return After Crash'].iloc[-1],GPNaft['Cumulative Return After Crash'].iloc[-1],HPEaft['Cumulative Return After Crash'].iloc[-1],HPQaft['Cumulative Return After Crash'].iloc[-1],INTCaft['Cumulative Return After Crash'].iloc[-1],IBMaft['Cumulative Return After Crash'].iloc[-1],INTUaft['Cumulative Return After Crash'].iloc[-1],IPGPaft['Cumulative Return After Crash'].iloc[-1],JKHYaft['Cumulative Return After Crash'].iloc[-1],JNPRaft['Cumulative Return After Crash'].iloc[-1],KEYSaft['Cumulative Return After Crash'].iloc[-1],KLACaft['Cumulative Return After Crash'].iloc[-1],LRCXaft['Cumulative Return After Crash'].iloc[-1],LDOSaft['Cumulative Return After Crash'].iloc[-1],MAaft['Cumulative Return After Crash'].iloc[-1],MXIMaft['Cumulative Return After Crash'].iloc[-1],MCHPaft['Cumulative Return After Crash'].iloc[-1],MUaft['Cumulative Return After Crash'].iloc[-1],MSFTaft['Cumulative Return After Crash'].iloc[-1],MSIaft['Cumulative Return After Crash'].iloc[-1],NTAPaft['Cumulative Return After Crash'].iloc[-1],NLOKaft['Cumulative Return After Crash'].iloc[-1],NVDAaft['Cumulative Return After Crash'].iloc[-1],ORCLaft['Cumulative Return After Crash'].iloc[-1],PAYXaft['Cumulative Return After Crash'].iloc[-1],PAYCaft['Cumulative Return After Crash'].iloc[-1],PYPLaft['Cumulative Return After Crash'].iloc[-1],QRVOaft['Cumulative Return After Crash'].iloc[-1],QCOMaft['Cumulative Return After Crash'].iloc[-1],CRMaft['Cumulative Return After Crash'].iloc[-1],STXaft['Cumulative Return After Crash'].iloc[-1],NOWaft['Cumulative Return After Crash'].iloc[-1],SWKSaft['Cumulative Return After Crash'].iloc[-1],SNPSaft['Cumulative Return After Crash'].iloc[-1],TELaft['Cumulative Return After Crash'].iloc[-1],TXNaft['Cumulative Return After Crash'].iloc[-1],VRSNaft['Cumulative Return After Crash'].iloc[-1],Vaft['Cumulative Return After Crash'].iloc[-1],WDCaft['Cumulative Return After Crash'].iloc[-1],WUaft['Cumulative Return After Crash'].iloc[-1],XRXaft['Cumulative Return After Crash'].iloc[-1],XLNXaft['Cumulative Return After Crash'].iloc[-1],ZBRAaft['Cumulative Return After Crash'].iloc[-1],ATVIaft['Cumulative Return After Crash'].iloc[-1],GOOGLaft['Cumulative Return After Crash'].iloc[-1],GOOGaft['Cumulative Return After Crash'].iloc[-1],Taft['Cumulative Return After Crash'].iloc[-1],CTLaft['Cumulative Return After Crash'].iloc[-1],CHTRaft['Cumulative Return After Crash'].iloc[-1],CMCSAaft['Cumulative Return After Crash'].iloc[-1],DISCAaft['Cumulative Return After Crash'].iloc[-1],DISCKaft['Cumulative Return After Crash'].iloc[-1],DISHaft['Cumulative Return After Crash'].iloc[-1],EAaft['Cumulative Return After Crash'].iloc[-1],FBaft['Cumulative Return After Crash'].iloc[-1],FOXAaft['Cumulative Return After Crash'].iloc[-1],FOXaft['Cumulative Return After Crash'].iloc[-1],IPGaft['Cumulative Return After Crash'].iloc[-1],LYVaft['Cumulative Return After Crash'].iloc[-1],NFLXaft['Cumulative Return After Crash'].iloc[-1],NWSAaft['Cumulative Return After Crash'].iloc[-1],NWSaft['Cumulative Return After Crash'].iloc[-1],OMCaft['Cumulative Return After Crash'].iloc[-1],TMUSaft['Cumulative Return After Crash'].iloc[-1],TTWOaft['Cumulative Return After Crash'].iloc[-1],TWTRaft['Cumulative Return After Crash'].iloc[-1],VZaft['Cumulative Return After Crash'].iloc[-1],VIACaft['Cumulative Return After Crash'].iloc[-1],DISaft['Cumulative Return After Crash'].iloc[-1],AESaft['Cumulative Return After Crash'].iloc[-1],LNTaft['Cumulative Return After Crash'].iloc[-1],AEEaft['Cumulative Return After Crash'].iloc[-1],AEPaft['Cumulative Return After Crash'].iloc[-1],AWKaft['Cumulative Return After Crash'].iloc[-1],ATOaft['Cumulative Return After Crash'].iloc[-1],CNPaft['Cumulative Return After Crash'].iloc[-1],CMSaft['Cumulative Return After Crash'].iloc[-1],EDaft['Cumulative Return After Crash'].iloc[-1],Daft['Cumulative Return After Crash'].iloc[-1],DTEaft['Cumulative Return After Crash'].iloc[-1],DUKaft['Cumulative Return After Crash'].iloc[-1],EIXaft['Cumulative Return After Crash'].iloc[-1],ETRaft['Cumulative Return After Crash'].iloc[-1],EVRGaft['Cumulative Return After Crash'].iloc[-1],ESaft['Cumulative Return After Crash'].iloc[-1],EXCaft['Cumulative Return After Crash'].iloc[-1],FEaft['Cumulative Return After Crash'].iloc[-1],NEEaft['Cumulative Return After Crash'].iloc[-1],NIaft['Cumulative Return After Crash'].iloc[-1],NRGaft['Cumulative Return After Crash'].iloc[-1],PNWaft['Cumulative Return After Crash'].iloc[-1],PPLaft['Cumulative Return After Crash'].iloc[-1],PEGaft['Cumulative Return After Crash'].iloc[-1],SREaft['Cumulative Return After Crash'].iloc[-1],SOaft['Cumulative Return After Crash'].iloc[-1],WECaft['Cumulative Return After Crash'].iloc[-1],XELaft['Cumulative Return After Crash'].iloc[-1],AREaft['Cumulative Return After Crash'].iloc[-1],AMTaft['Cumulative Return After Crash'].iloc[-1],AIVaft['Cumulative Return After Crash'].iloc[-1],AVBaft['Cumulative Return After Crash'].iloc[-1],BXPaft['Cumulative Return After Crash'].iloc[-1],CBREaft['Cumulative Return After Crash'].iloc[-1],CCIaft['Cumulative Return After Crash'].iloc[-1],DLRaft['Cumulative Return After Crash'].iloc[-1],DREaft['Cumulative Return After Crash'].iloc[-1],EQIXaft['Cumulative Return After Crash'].iloc[-1],EQRaft['Cumulative Return After Crash'].iloc[-1],ESSaft['Cumulative Return After Crash'].iloc[-1],EXRaft['Cumulative Return After Crash'].iloc[-1],FRTaft['Cumulative Return After Crash'].iloc[-1],PEAKaft['Cumulative Return After Crash'].iloc[-1],HSTaft['Cumulative Return After Crash'].iloc[-1],IRMaft['Cumulative Return After Crash'].iloc[-1],KIMaft['Cumulative Return After Crash'].iloc[-1],MAAaft['Cumulative Return After Crash'].iloc[-1],PLDaft['Cumulative Return After Crash'].iloc[-1],PSAaft['Cumulative Return After Crash'].iloc[-1],Oaft['Cumulative Return After Crash'].iloc[-1],REGaft['Cumulative Return After Crash'].iloc[-1],SBACaft['Cumulative Return After Crash'].iloc[-1],SPGaft['Cumulative Return After Crash'].iloc[-1],SLGaft['Cumulative Return After Crash'].iloc[-1],UDRaft['Cumulative Return After Crash'].iloc[-1],VTRaft['Cumulative Return After Crash'].iloc[-1],VNOaft['Cumulative Return After Crash'].iloc[-1],WELLaft['Cumulative Return After Crash'].iloc[-1],WYaft['Cumulative Return After Crash'].iloc[-1]]}
dftot = pd.DataFrame(cumret, columns = ['Cumulative Returns 12/4-6/5', 'Cumulative Returns 12/4-2/20', 'Cumulative Returns 2/20-3/23', 'Cumulative Returns 3/23-6/5'], index= ['S&P 500','Apache','Baker','Cabot','Chevron','Concho','Conoco','Devon','Diamond','EOG','Exxon','Halliburton','Hess','Holly','Kinder','MarathonOil','MarathonPet','National','Noble','Occidental','Oneok','Phillips66','Pioneer','Schlumberger','Technip','Valero','Williams','APD','ALB','AMCR','AVY','BLL','CE','CF','CTVA','DOW','DD','EMN','ECL','FMC','FCX','IP','IFF','LIN','LYB','MLM','MOS','NEM','NUE','PKG','PPG','SEE','SHW','VMC','WRK','MMM','ALK','ALLE','AAL','AME','AOS','BA','CHRW','CAT','CTAS','CPRT','CSX','CMI','DE','DAL','DOV','ETN','EMR','EFX','EXPD','FAST','FDX','FLS','FTV','FBHS','GD','GE','GWW','HON','HWM','HII','IEX','INFO','ITW','IR','J','JBHT','JCI','KSU','LHX','LMT','MAS','NLSN','NSC','NOC','ODFL','PCAR','PH','PNR','PWR','RTX','RSG','RHI','ROK','ROL','ROP','SNA','LUV','SWK','TXT','TT','TDG','UNP','UAL','UPS','URI','VRSK','WAB','WM','XYL','AAP','AMZN','APTV','AZO','BBY','BKNG','BWA','KMX','CCL','CMG','DHI','DRI','DG','DLTR','DPZ','EBAY','EXPE','F','GPS','GRMN','GM','GPC','HRB','HBI','HOG','HAS','HLT','HD','KSS','LB','LVS','LEG','LEN','LKQ','LOW','MAR','MCD','MGM','MHK','NWL','NKE','JWN','NCLH','NVR','ORLY','PHM','PVH','RL','ROST','RCL','SBUX','TPR','TGT','TIF','TJX','TSCO','ULTA','UAA','UA','VFC','WHR','WYNN','YUM','MO','ADM','BF.B','CPB','CHD','CLX','KO','CL','CAG','STZ','COST','COTY','EL','GIS','HSY','HRL','SJM','K','KMB','KHC','KR','LW','MKC','TAP','MDLZ','MNST','PEP','PM','PG','SYY','TSN','WMT','WBA','ABT','ABBV','ABMD','A','ALXN','ALGN','ABC','AMGN','ANTM','BAX','BDX','BIIB','BSX','BMY','CAH','CNC','CERN','CI','COO','CVS','DHR','DVA','XRAY','DXCM','EW','GILD','HCA','HSIC','HOLX','HUM','IDXX','ILMN','INCY','ISRG','IQV','JNJ','LH','LLY','MCK','MDT','MRK','MTD','MYL','PKI','PRGO','PFE','DGX','REGN','RMD','STE','SYK','TFX','TMO','UNH','UHS','VAR','VRTX','WAT','WST','ZBH','ZTS','AFL','ALL','AXP','AIG','AMP','AON','AJG','AIZ','BAC','BK','BRK.B','BLK','COF','CBOE','SCHW','CB','CINF','C','CFG','CME','CMA','DFS','ETFC','RE','FITB','FRC','BEN','GL','GS','HIG','HBAN','ICE','IVZ','JPM','KEY','LNC','L','MTB','MKTX','MMC','MET','MCO','MS','MSCI','NDAQ','NTRS','PBCT','PNC','PFG','PGR','PRU','RJF','RF','SPGI','STT','SIVB','SYF','TROW','TRV','TFC','USB','UNM','WRB','WFC','WLTW','ZION','ACN','ADBE','AMD','AKAM','ADS','APH','ADI','ANSS','AAPL','AMAT','ANET','ADSK','ADP','AVGO','BR','CDNS','CDW','CSCO','CTXS','CTSH','GLW','DXC','FFIV','FIS','FISV','FLT','FLIR','FTNT','IT','GPN','HPE','HPQ','INTC','IBM','INTU','IPGP','JKHY','JNPR','KEYS','KLAC','LRCX','LDOS','MA','MXIM','MCHP','MU','MSFT','MSI','NTAP','NLOK','NVDA','ORCL','PAYX','PAYC','PYPL','QRVO','QCOM','CRM','STX','NOW','SWKS','SNPS','TEL','TXN','VRSN','V','WDC','URI','XRX','XLNX','ZBRA','ATVI','GOOGL','GOOG','T','CTL','CHTR','CMCSA','DISCA','DISCK','DISH','EA','FB','FOXA','FOX','IPG','LYV','NFLX','NWSA','NWS','OMC','TMUS','TTWO','TWTR','VZ','VIAC','DIS','AES','LNT','AEE','AEP','AWK','ATO','CNP','CMS','ED','D','DTE','DUK','EIX','ETR','EVRG','ES','EXC','FE','NEE','NI','NRG','PNW','PPL','PEG','SRE','SO','WEC','XEL','ARE','AMT','AIV','AVB','BXP','CBRE','CCI','DLR','DRE','EQIX','EQR','ESS','EXR','FRT','PEAK','HST','IRM','KIM','MAA','PLD','PSA','O','REG','SBAC','SPG','SLG','UDR','VTR','VNO','WELL','WY'])
pd.DataFrame(dftot)
dftot.sort_values('Cumulative Returns 3/23-6/5', ascending=False)
dftot.sort_values('Cumulative Returns 12/4-2/20', ascending=False)